sensu-plugins-logstash 0.1.1 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d86387fa4035cb642d49989af1c87eb85c7c193
4
- data.tar.gz: 3873ed1924a389b4ca17a7975462cec1c7b2b21a
3
+ metadata.gz: a64df7f519c8ab4e45b2f1bed59fc4c53ef75753
4
+ data.tar.gz: 7bb91d51758f6cc94e299f8a171d650a9a38db3b
5
5
  SHA512:
6
- metadata.gz: ea6463ee04eddf5f256a4022b3e72e092c641e199acccc743cba8647a7d33d3173fd604c3e66db4855297146cc4c8c9a293bd365f8fd976e109868d1241d36f2
7
- data.tar.gz: 41421ec778a055e6239a23bc7668a8ded0c13745aa4318917e9fa8dff9d03d9c07cb1f24329e02d785b9f1d17c6f4445acb0a169bbcf697c0118d1a91fa28b3b
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` handler definition
11
- attribute into outgoing messages, if provided.
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/0.1.0...HEAD
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
- "server": "redis.example.tld",
21
- "port": 6379,
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",
@@ -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
- case settings['logstash']['output']
88
- when 'redis'
89
- redis = Redis.new(host: settings['logstash']['server'], port: settings['logstash']['port'])
90
- redis.lpush(settings['logstash']['list'], logstash_msg.to_json)
91
- when 'udp'
92
- socket = UDPSocket.new
93
- socket.send(JSON.generate(logstash_msg), 0, settings['logstash']['server'], settings['logstash']['port'])
94
- socket.close
95
- when 'tcp'
96
- socket = TCPSocket.new(settings['logstash']['server'], settings['logstash']['port'])
97
- socket.puts(JSON.generate(logstash_msg))
98
- socket.close
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
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsLogstash
2
2
  module Version
3
- MAJOR = 0
4
- MINOR = 1
5
- PATCH = 1
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ PATCH = 0
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-logstash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
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-03-15 00:00:00.000000000 Z
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: 1.9.3
215
+ version: 2.0.0
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - ">="