logstash-output-stomp 2.0.4 → 2.0.5

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: f5bb261d9d7fa438daecc5d54fbe8e71771cb2e8
4
- data.tar.gz: 26167c125fb18bebf2160f7574ed361769692fc5
3
+ metadata.gz: fe2392a8a6785427e4508f79908db9ff0c1dd330
4
+ data.tar.gz: 629a9bb8a4ce6f868b2eaf8536bbb002ff089ad7
5
5
  SHA512:
6
- metadata.gz: 71d496d051867c33a02939f2cf348f264c4fd2e7f1b0871ab001670850c4836628de8f765f724a7fdb5f7c0c1c8b61f2cac9a8164d14d1c3c95e958fdf2be26e
7
- data.tar.gz: c8cb20a853a36f10c263661bd2fe05e424793a1f5c0ccbb5de749a79f7c7b6e213b30ecb24c0851253e2529064f9ec07d7f59eae331687696a328592eb10511d
6
+ metadata.gz: 9e6b9c6c0ecc3bc678b2fa6927a5ddaa3d844f706bd20d32857c727ca29a9319dcb19eee079245b3500b6fbc5bd9ea8a6a37b0bcfeba135ccb97611aaaa3a60d
7
+ data.tar.gz: 0b04edd2c2054937cc9498854fb709b5adb7ad9f866d6453399a45d2524919a61cded2e28ebe8c7fa24f8dab482fa94e5320db35e9f31f7bd38d0dc3ab97e24a
@@ -1,7 +1,14 @@
1
- # 2.0.4
1
+ ## 2.0.5
2
+ - Fix a data loss issue when shutting down logstash #8
3
+ - Move from receive to `multi_receive` api and send events per batch #9
4
+ - Allow to send custom header #3
5
+
6
+ ## 2.0.4
2
7
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
- # 2.0.3
8
+
9
+ ## 2.0.3
4
10
  - New dependency requirements for logstash-core for the 5.0 release
11
+
5
12
  ## 2.0.0
6
13
  - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
7
14
  instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Build
4
- Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-stomp-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-stomp-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-output-stomp.svg)](https://travis-ci.org/logstash-plugins/logstash-output-stomp)
5
4
 
6
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
7
6
 
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
56
55
  ```
57
56
  - Install plugin
58
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
59
62
  bin/plugin install --no-verify
63
+
60
64
  ```
61
65
  - Run Logstash with your plugin
62
66
  ```sh
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
74
78
  ```
75
79
  - Install the plugin from the Logstash home
76
80
  ```sh
77
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
78
87
  ```
79
88
  - Start Logstash and proceed to test the plugin
80
89
 
@@ -27,6 +27,12 @@ class LogStash::Outputs::Stomp < LogStash::Outputs::Base
27
27
  # The vhost to use
28
28
  config :vhost, :validate => :string, :default => nil
29
29
 
30
+ # Custom headers to send with each message. Supports string expansion, meaning
31
+ # %{foo} values will expand to the field value.
32
+ #
33
+ # Example: headers => ["amq-msg-type", "text", "host", "%{host}"]
34
+ config :headers, :validate => :hash
35
+
30
36
  # Enable debugging output?
31
37
  config :debug, :validate => :boolean, :default => false
32
38
 
@@ -57,11 +63,28 @@ class LogStash::Outputs::Stomp < LogStash::Outputs::Base
57
63
 
58
64
  connect
59
65
  end # def register
60
-
61
- def receive(event)
62
-
63
66
 
64
- @logger.debug(["stomp sending event", { :host => @host, :event => event }])
65
- @client.send(event.sprintf(@destination), event.to_json)
67
+ public
68
+ def close
69
+ @logger.warn("Disconnecting from stomp broker")
70
+ @client.disconnect if @client.connected?
71
+ end # def close
72
+
73
+ def multi_receive(events)
74
+
75
+ headers = Hash.new
76
+ if @headers
77
+ @headers.each do |k,v|
78
+ headers[k] = event.sprintf(v)
79
+ end
80
+ end
81
+
82
+ @logger.debug(["stomp sending events in batch", { :host => @host, :events => events.length, :headers => headers }])
83
+
84
+ @client.transaction do |t|
85
+ events.each { |event|
86
+ t.send(event.sprintf(@destination), event.to_json, headers)
87
+ }
88
+ end
66
89
  end # def receive
67
90
  end # class LogStash::Outputs::Stomp
@@ -1,10 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
-
3
2
  s.name = 'logstash-output-stomp'
4
- s.version = '2.0.4'
3
+ s.version = '2.0.5'
5
4
  s.licenses = ['Apache License (2.0)']
6
5
  s.summary = "Send events to a stomp server"
7
- s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
6
+ s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
8
7
  s.authors = ["Elastic"]
9
8
  s.email = 'info@elastic.co'
10
9
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-stomp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
55
+ description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
56
56
  email: info@elastic.co
57
57
  executables: []
58
58
  extensions: []