logstash-input-bunny 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 259e391542e40810f649e7e26f5272676c95733a
4
+ data.tar.gz: d04518400d59c30d0a1eb3b5d543bded90e57164
5
+ SHA512:
6
+ metadata.gz: 468a42c61dce3cc2be23771f618571517dce693a683a96b11ec234aae7684793b3ba3d6f2555829e20e4121ba9bf545d3939877982889c8e7def1f09b0fba615
7
+ data.tar.gz: 111b235d13ba3711500c456f5b016e401473e0ccc7b90a739fb98e0b7f65de38c6f6c9d92fd880bc50444e527b4e94e84d7b0550192bcbaa63be55fc429bf9e2
data/CONTRIBUTORS ADDED
@@ -0,0 +1,22 @@
1
+ The following is a list of people who have contributed ideas, code, bug
2
+ reports, or in general have helped logstash along its way.
3
+
4
+ Contributors:
5
+ * Avishai Ish-Shalom (avishai-ish-shalom)
6
+ * Jonathan Van Eenwyk (jdve)
7
+ * Jordan Sissel (jordansissel)
8
+ * João Duarte (jsvd)
9
+ * Mathieu MILLET (htam-net)
10
+ * Michael Klishin (michaelklishin)
11
+ * Michael Zaccari (mzaccari)
12
+ * Nick Ethier (nickethier)
13
+ * Pier-Hugues Pellerin (ph)
14
+ * Richard Pijnenburg (electrical)
15
+ * Suyog Rao (suyograo)
16
+ * Tim Potter (tpot)
17
+ * avleen
18
+
19
+ Note: If you've sent us patches, bug reports, or otherwise contributed to
20
+ Logstash, and you aren't on the list above and want to be, please let us know
21
+ and we'll make sure you're here. Contributions from folks like you are what make
22
+ open source awesome.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Logstash Plugin
2
+
3
+ This is a plugin for [Logstash](https://github.com/elasticsearch/logstash).
4
+
5
+ It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
6
+
7
+ ## Documentation
8
+
9
+ Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elasticsearch.org/guide/en/logstash/current/).
10
+
11
+ - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
12
+ - For more asciidoc formatting tips, see the excellent reference here https://github.com/elasticsearch/docs#asciidoc-guide
13
+
14
+ ## Need Help?
15
+
16
+ Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com mailing list.
17
+
18
+ ## Developing
19
+
20
+ ### 1. Plugin Developement and Testing
21
+
22
+ #### Code
23
+ - To get started, you'll need JRuby with the Bundler gem installed.
24
+
25
+ - Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
26
+
27
+ - Install dependencies
28
+ ```sh
29
+ bundle install
30
+ ```
31
+
32
+ #### Test
33
+
34
+ - Update your dependencies
35
+
36
+ ```sh
37
+ bundle install
38
+ ```
39
+
40
+ - Run tests
41
+
42
+ ```sh
43
+ bundle exec rspec
44
+ ```
45
+
46
+ ### 2. Running your unpublished Plugin in Logstash
47
+
48
+ #### 2.1 Run in a local Logstash clone
49
+
50
+ - Edit Logstash `Gemfile` and add the local plugin path, for example:
51
+ ```ruby
52
+ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
53
+ ```
54
+ - Install plugin
55
+ ```sh
56
+ bin/plugin install --no-verify
57
+ ```
58
+ - Run Logstash with your plugin
59
+ ```sh
60
+ bin/logstash -e 'filter {awesome {}}'
61
+ ```
62
+ At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
63
+
64
+ #### 2.2 Run in an installed Logstash
65
+
66
+ You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
67
+
68
+ - Build your plugin gem
69
+ ```sh
70
+ gem build logstash-filter-awesome.gemspec
71
+ ```
72
+ - Install the plugin from the Logstash home
73
+ ```sh
74
+ bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
75
+ ```
76
+ - Start Logstash and proceed to test the plugin
77
+
78
+ ## Contributing
79
+
80
+ All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
81
+
82
+ Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
83
+
84
+ It is more important to the community that you are able to contribute.
85
+
86
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ @files=[]
2
+
3
+ task :default do
4
+ system("rake -T")
5
+ end
6
+
7
+ require "logstash/devutils/rake"
@@ -0,0 +1,126 @@
1
+ # encoding: utf-8
2
+ require "logstash/inputs/threadable"
3
+ require "logstash/namespace"
4
+
5
+ # Pull events from a RabbitMQ exchange.
6
+ #
7
+ # The default settings will create an entirely transient queue and listen for all messages by default.
8
+ # If you need durability or any other advanced settings, please set the appropriate options
9
+ #
10
+ # This has been tested with Bunny 1.7.x, which supports RabbitMQ 2.x and 3.x. You can
11
+ # find links to both here:
12
+ #
13
+ # * Bunny - <https://github.com/ruby-amqp/bunny>
14
+ class LogStash::Inputs::Bunny < LogStash::Inputs::Threadable
15
+
16
+ config_name "bunny"
17
+
18
+ #
19
+ # Connection
20
+ #
21
+
22
+ # RabbitMQ server address
23
+ config :host, :validate => :string, :required => true
24
+
25
+ # RabbitMQ port to connect on
26
+ config :port, :validate => :number, :default => 5672
27
+
28
+ # RabbitMQ username
29
+ config :user, :validate => :string, :default => "guest"
30
+
31
+ # RabbitMQ password
32
+ config :password, :validate => :password, :default => "guest"
33
+
34
+ # The vhost to use. If you don't know what this is, leave the default.
35
+ config :vhost, :validate => :string, :default => "/"
36
+
37
+ # Enable or disable SSL
38
+ config :ssl, :validate => :boolean, :default => false
39
+ config :ssl_cert, :validate => :string
40
+ config :ssl_key, :validate => :string
41
+ config :ssl_ca_cert, :validate => :string
42
+
43
+ # Validate SSL certificate
44
+ config :verify_ssl, :validate => :boolean, :default => false
45
+ config :verify_peer, :validate => :boolean, :default => false
46
+
47
+ # Enable or disable logging
48
+ config :debug, :validate => :boolean, :default => false, :deprecated => "Use the logstash --debug flag for this instead."
49
+
50
+
51
+
52
+ #
53
+ # Queue & Consumer
54
+ #
55
+
56
+ # The name of the queue Logstash will consume events from.
57
+ config :queue, :validate => :string, :default => ""
58
+
59
+ # Is this queue durable? (aka; Should it survive a broker restart?)
60
+ config :durable, :validate => :boolean, :default => false
61
+
62
+ # Should the queue be deleted on the broker when the last consumer
63
+ # disconnects? Set this option to `false` if you want the queue to remain
64
+ # on the broker, queueing up messages until a consumer comes along to
65
+ # consume them.
66
+ config :auto_delete, :validate => :boolean, :default => false
67
+
68
+ # Is the queue exclusive? Exclusive queues can only be used by the connection
69
+ # that declared them and will be deleted when it is closed (e.g. due to a Logstash
70
+ # restart).
71
+ config :exclusive, :validate => :boolean, :default => false
72
+
73
+ # Extra queue arguments as an array.
74
+ # To make a RabbitMQ queue mirrored, use: `{"x-ha-policy" => "all"}`
75
+ config :arguments, :validate => :array, :default => {}
76
+
77
+ # Prefetch count. Number of messages to prefetch
78
+ config :prefetch_count, :validate => :number, :default => 256
79
+
80
+ # Enable message acknowledgement
81
+ config :ack, :validate => :boolean, :default => true
82
+
83
+ # Passive queue creation? Useful for checking queue existance without modifying server state
84
+ config :passive, :validate => :boolean, :default => false
85
+
86
+
87
+
88
+ #
89
+ # (Optional) Exchange binding
90
+ #
91
+
92
+ # Optional.
93
+ #
94
+ # The name of the exchange to bind the queue to.
95
+ config :exchange, :validate => :string
96
+
97
+ # Optional.
98
+ #
99
+ # The routing key to use when binding a queue to the exchange.
100
+ # This is only relevant for direct or topic exchanges.
101
+ #
102
+ # * Routing keys are ignored on fanout exchanges.
103
+ # * Wildcards are not valid on direct exchanges.
104
+ config :key, :validate => :string, :default => "logstash"
105
+
106
+
107
+ def initialize(params)
108
+ params["codec"] = "json" if !params["codec"]
109
+
110
+ super
111
+ end
112
+
113
+ require "logstash/inputs/rabbitmq/bunny"
114
+ include BunnyImpl
115
+
116
+ def register
117
+ super
118
+
119
+ if @ssl and @ssl_cert
120
+ @session[:tls_cert] = @ssl_cert
121
+ @session[:tls_key] = @ssl_key
122
+ @session[:tls_ca_certificates] = [@ssl_ca_Cert]
123
+ @session[:verify_peer] = @verify_peer
124
+ end
125
+ end # class LogStash::Inputs::RabbitMQ
126
+
@@ -0,0 +1,31 @@
1
+ Gem::Specification.new do |s|
2
+
3
+ s.name = 'logstash-input-bunny'
4
+ s.version = '0.1.0'
5
+ s.licenses = ['Apache License (2.0)']
6
+ s.summary = "Pull events from a RabbitMQ exchange."
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"
8
+ s.authors = ["Jonathan Serafini"]
9
+ s.email = 'jonathan@lightspeedpos.com'
10
+ s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
11
+ s.require_paths = ["lib"]
12
+
13
+ # Files
14
+ s.files = `git ls-files`.split($\)+::Dir.glob('vendor/*')
15
+
16
+ # Tests
17
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
+
19
+ # Special flag to let us know this is actually a logstash plugin
20
+ s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
21
+
22
+ # Gem dependencies
23
+ s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
24
+ s.add_runtime_dependency 'logstash-codec-json'
25
+ s.add_runtime_dependency 'logstash-input-rabbitmq'
26
+
27
+ s.add_runtime_dependency 'bunny', ['>= 1.6.0']
28
+
29
+ s.add_development_dependency 'logstash-devutils'
30
+ end
31
+
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rspec/spec_helper"
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstash-input-bunny
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jonathan Serafini
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logstash-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.4.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: logstash-codec-json
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: logstash-input-rabbitmq
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bunny
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 1.6.0
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.6.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: logstash-devutils
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ description: This gem is a logstash plugin required to be installed on top of the
90
+ Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not
91
+ a stand-alone program
92
+ email: jonathan@lightspeedpos.com
93
+ executables: []
94
+ extensions: []
95
+ extra_rdoc_files: []
96
+ files:
97
+ - CONTRIBUTORS
98
+ - Gemfile
99
+ - LICENSE
100
+ - README.md
101
+ - Rakefile
102
+ - lib/logstash/inputs/bunny.rb
103
+ - logstash-input-bunny.gemspec
104
+ - spec/inputs/rabbitmq_spec.rb
105
+ homepage: http://www.elastic.co/guide/en/logstash/current/index.html
106
+ licenses:
107
+ - Apache License (2.0)
108
+ metadata:
109
+ logstash_plugin: 'true'
110
+ logstash_group: input
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.4.5
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: Pull events from a RabbitMQ exchange.
131
+ test_files:
132
+ - spec/inputs/rabbitmq_spec.rb
133
+ has_rdoc: