sensu-plugins-logs 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -3
- data/bin/check-log.rb +12 -7
- data/lib/sensu-plugins-logs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1255760d5b9cd18ee05eccc9c251683acf42f785
|
4
|
+
data.tar.gz: 90b5fd4f74d16d4ebae49e3db735c622baf5d96e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38478d5a2d08343171e5593631781340293d14f40f892ba1b6b5847e4968a3b27df184e827c5ef390e3f0d6a721294fea213c81e4e44d2504992000a2933b276
|
7
|
+
data.tar.gz: 593940bb2a20c07b827044a5f2ea60f79ddbb7ab83c3dc0e53c5a717d0fc6dfed03215d701d61d1f33f65ef81fc784a4f1e382cf08d8b16523bac13a82d8221d
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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.
|
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
|
data/bin/check-log.rb
CHANGED
@@ -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
|
262
|
-
|
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
|
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.
|
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-
|
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.
|
201
|
+
rubygems_version: 2.6.13
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: Sensu plugins for logs
|