sensu-plugins-logs 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/bin/check-log.rb +13 -0
- data/lib/sensu-plugins-logs/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc78ada8b9f897dae9b51a55d3c873e71a515d02
|
4
|
+
data.tar.gz: 2e5dbf9fbf489a095909d34aa2ab60bef47d864e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a5f8e25baca314d153abbb8244f7f4bef3cd177b45c91c611e9ddd9768a171910e03ab6633e7e41d877979edca1cb7f450740467fe46a8eaf4cef60dff07036
|
7
|
+
data.tar.gz: d29c4f93e6208ffad9e00b140f00fbfb4827b842da272cb1c06f03fc83beac76ef4253355a3b31e98f101c9c0d4a6935981b5744ce76b586445fc1f4926f45dd
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
|
8
|
+
## [1.2.0] - 2017-07-04
|
9
|
+
### Added
|
10
|
+
- Support of UTF16 encoded characters (@avoosh)
|
11
|
+
|
7
12
|
## [1.1.2] - 2017-05-25
|
8
13
|
### Fixed
|
9
14
|
- Write the state file atomically by using flock where available (@nlopes)
|
@@ -48,7 +53,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
48
53
|
### Added
|
49
54
|
- initial release
|
50
55
|
|
51
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.
|
56
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.2.0...HEAD
|
57
|
+
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.2.2...1.2.0
|
52
58
|
[1.1.2]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.1...1.1.2
|
53
59
|
[1.1.1]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.0...1.1.1
|
54
60
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.0.0...1.1.0
|
data/bin/check-log.rb
CHANGED
@@ -128,6 +128,15 @@ class CheckLog < Sensu::Plugin::Check::CLI
|
|
128
128
|
proc: proc(&:to_i),
|
129
129
|
default: 250
|
130
130
|
|
131
|
+
# Use this option when you expecting your log lines to contain invalid byte sequence in utf-8.
|
132
|
+
# https://github.com/sensu-plugins/sensu-plugins-logs/pull/26
|
133
|
+
option :encode_utf16,
|
134
|
+
description: 'Encode line with utf16 before matching',
|
135
|
+
short: '-eu',
|
136
|
+
long: '--encode-utf16',
|
137
|
+
boolean: true,
|
138
|
+
default: false
|
139
|
+
|
131
140
|
def run
|
132
141
|
unknown 'No log file specified' unless config[:log_file] || config[:file_pattern]
|
133
142
|
unknown 'No pattern specified' unless config[:pattern]
|
@@ -208,6 +217,10 @@ class CheckLog < Sensu::Plugin::Check::CLI
|
|
208
217
|
line = get_log_entry(line)
|
209
218
|
end
|
210
219
|
|
220
|
+
if config[:encode_utf16]
|
221
|
+
line = line.encode('UTF-16', invalid: :replace, replace: '')
|
222
|
+
end
|
223
|
+
|
211
224
|
line = line.encode('UTF-8', invalid: :replace, replace: '')
|
212
225
|
bytes_read += line.bytesize
|
213
226
|
if config[:case_insensitive]
|
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.
|
4
|
+
version: 1.2.0
|
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-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|