sensu-plugins-logs 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc78ada8b9f897dae9b51a55d3c873e71a515d02
4
- data.tar.gz: 2e5dbf9fbf489a095909d34aa2ab60bef47d864e
3
+ metadata.gz: 1255760d5b9cd18ee05eccc9c251683acf42f785
4
+ data.tar.gz: 90b5fd4f74d16d4ebae49e3db735c622baf5d96e
5
5
  SHA512:
6
- metadata.gz: 6a5f8e25baca314d153abbb8244f7f4bef3cd177b45c91c611e9ddd9768a171910e03ab6633e7e41d877979edca1cb7f450740467fe46a8eaf4cef60dff07036
7
- data.tar.gz: d29c4f93e6208ffad9e00b140f00fbfb4827b842da272cb1c06f03fc83beac76ef4253355a3b31e98f101c9c0d4a6935981b5744ce76b586445fc1f4926f45dd
6
+ metadata.gz: 38478d5a2d08343171e5593631781340293d14f40f892ba1b6b5847e4968a3b27df184e827c5ef390e3f0d6a721294fea213c81e4e44d2504992000a2933b276
7
+ data.tar.gz: 593940bb2a20c07b827044a5f2ea60f79ddbb7ab83c3dc0e53c5a717d0fc6dfed03215d701d61d1f33f65ef81fc784a4f1e382cf08d8b16523bac13a82d8221d
@@ -1,10 +1,21 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.2.1] - 2017-09-23
9
+ ### Added
10
+ - ruby 2.4 testing (@majormoses)
11
+
12
+ ### Fixed
13
+ - Fixed unhandled encoding exception when using the `log-pattern` option (@jhshadi)
14
+ - PR template spelling "compatibility"
15
+
16
+ ### Changed
17
+ - updated CHANGELOG guidelines location (@majormoses)
18
+
8
19
  ## [1.2.0] - 2017-07-04
9
20
  ### Added
10
21
  - Support of UTF16 encoded characters (@avoosh)
@@ -53,7 +64,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
53
64
  ### Added
54
65
  - initial release
55
66
 
56
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.2.0...HEAD
67
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.2.1...HEAD
68
+ [1.2.1]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.2.0...1.2.1
57
69
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.2.2...1.2.0
58
70
  [1.1.2]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.1...1.1.2
59
71
  [1.1.1]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.0...1.1.1
@@ -213,15 +213,11 @@ class CheckLog < Sensu::Plugin::Check::CLI
213
213
  @log.seek(@bytes_to_skip, File::SEEK_SET) if @bytes_to_skip > 0
214
214
  # #YELLOW
215
215
  @log.each_line do |line|
216
+ line = encode_line(line)
216
217
  if config[:log_pattern]
217
218
  line = get_log_entry(line)
218
219
  end
219
220
 
220
- if config[:encode_utf16]
221
- line = line.encode('UTF-16', invalid: :replace, replace: '')
222
- end
223
-
224
- line = line.encode('UTF-8', invalid: :replace, replace: '')
225
221
  bytes_read += line.bytesize
226
222
  if config[:case_insensitive]
227
223
  m = line.downcase.match(config[:pattern].downcase) unless line.match(config[:exclude])
@@ -250,6 +246,8 @@ class CheckLog < Sensu::Plugin::Check::CLI
250
246
  log_entry = [first_line]
251
247
 
252
248
  @log.each_line do |line|
249
+ line = encode_line(line)
250
+
253
251
  if !line.match(config[:log_pattern])
254
252
  log_entry.push(line)
255
253
  else
@@ -258,7 +256,14 @@ class CheckLog < Sensu::Plugin::Check::CLI
258
256
  end
259
257
  end
260
258
 
261
- log_entry = log_entry.join('')
262
- log_entry
259
+ log_entry.join('')
260
+ end
261
+
262
+ def encode_line(line)
263
+ if config[:encode_utf16]
264
+ line = line.encode('UTF-16', invalid: :replace, replace: '')
265
+ end
266
+
267
+ line.encode('UTF-8', invalid: :replace, replace: '')
263
268
  end
264
269
  end
@@ -2,7 +2,7 @@ module SensuPluginsLogs
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  version: '0'
199
199
  requirements: []
200
200
  rubyforge_project:
201
- rubygems_version: 2.4.5
201
+ rubygems_version: 2.6.13
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Sensu plugins for logs