sensu-plugins-logstash 0.1.1 → 1.0.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 +15 -3
- data/README.md +12 -3
- data/bin/handler-logstash.rb +14 -12
- data/lib/sensu-plugins-logstash/version.rb +3 -3
- 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: a64df7f519c8ab4e45b2f1bed59fc4c53ef75753
|
4
|
+
data.tar.gz: 7bb91d51758f6cc94e299f8a171d650a9a38db3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801106e014033c2148f6b2fc763085a6a78a18613795645682285625d47ba75cd971fd142cf1bf8e884e8399d862ee97957edd1d8fbf503c89b178321191955c
|
7
|
+
data.tar.gz: 7fac7d112439bd6b4661876e4fa36fc5285e528e3e86d85587d43a85981b107090d893832a24f77ff2965d60a2e8a422ea20097b716613a352212a27441d87d9
|
data/CHANGELOG.md
CHANGED
@@ -4,11 +4,21 @@ 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
|
+
## [1.0.0] - 2017-05-29
|
8
|
+
### Added
|
9
|
+
- testing on ruby 2.3
|
10
|
+
|
11
|
+
### Breaking Changes
|
12
|
+
- dropped ruby 1.9 support
|
13
|
+
- Added support to send to multiple endpoints
|
14
|
+
|
15
|
+
## [0.1.1] - 2017-03-15
|
16
|
+
- changed json dependency from '= 1.8.3' to '< 2.0.0'
|
7
17
|
|
8
18
|
## [0.1.1] - 2017-03-15
|
9
19
|
- changed json dependency from '= 1.8.3' to '< 2.0.0'
|
10
|
-
- handler-logstash.rb now merges value of `custom`
|
11
|
-
|
20
|
+
- handler-logstash.rb now merges value of `custom` attribute into
|
21
|
+
outgoing messages, if provided.
|
12
22
|
|
13
23
|
## [0.1.0] - 2016-08-10
|
14
24
|
- changed sensu-plugin dependecy from `= 1.2.0` to `~> 1.2`
|
@@ -30,7 +40,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
30
40
|
### Added
|
31
41
|
- initial release
|
32
42
|
|
33
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/
|
43
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/1.0.0...HEAD
|
44
|
+
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/0.1.1...1.0.0
|
45
|
+
[0.1.1]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/0.1.0...0.1.1
|
34
46
|
[0.1.0]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/0.0.4...0.1.0
|
35
47
|
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/0.0.3...0.0.4
|
36
48
|
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-logstash/compare/0.0.2...0.0.3
|
data/README.md
CHANGED
@@ -17,11 +17,20 @@
|
|
17
17
|
```
|
18
18
|
{
|
19
19
|
"logstash": {
|
20
|
-
"
|
21
|
-
|
20
|
+
"endpoint": [
|
21
|
+
{
|
22
|
+
"address": "host1.example.tld",
|
23
|
+
"port": 5000,
|
24
|
+
"output": "redis"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"address": "host2.example.tld",
|
28
|
+
"port": 5001,
|
29
|
+
"output": "logstash"
|
30
|
+
}
|
31
|
+
],
|
22
32
|
"list": "logstash",
|
23
33
|
"type": "sensu-logstash",
|
24
|
-
"output": "redis",
|
25
34
|
"custom": {
|
26
35
|
"thisFieldWillBeMergedIntoTheTopLevelOfOutgoingJSON": {
|
27
36
|
"metadata": "some metadata",
|
data/bin/handler-logstash.rb
CHANGED
@@ -84,18 +84,20 @@ class LogstashHandler < Sensu::Handler
|
|
84
84
|
# merge into the outgoing logstash message (at the top level) any JSON config defined under settings['logstash']['custom']
|
85
85
|
logstash_msg = logstash_msg.merge(settings['logstash']['custom']) if settings['logstash'].key?('custom') && !settings['logstash']['custom'].empty?
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
87
|
+
settings['logstash']['endpoint'].each do |endpoint|
|
88
|
+
case endpoint['output']
|
89
|
+
when 'redis'
|
90
|
+
redis = Redis.new(host: endpoint['address'], port: endpoint['port'])
|
91
|
+
redis.lpush(settings['logstash']['list'], logstash_msg.to_json)
|
92
|
+
when 'udp'
|
93
|
+
socket = UDPSocket.new
|
94
|
+
socket.send(JSON.generate(logstash_msg), 0, endpoint['address'], endpoint['port'])
|
95
|
+
socket.close
|
96
|
+
when 'tcp'
|
97
|
+
socket = TCPSocket.new(endpoint['address'], endpoint['port'])
|
98
|
+
socket.puts(JSON.generate(logstash_msg))
|
99
|
+
socket.close
|
100
|
+
end
|
99
101
|
end
|
100
102
|
end
|
101
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-logstash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.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-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -212,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
212
212
|
requirements:
|
213
213
|
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: 2.0.0
|
216
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
217
|
requirements:
|
218
218
|
- - ">="
|