logstash-input-redis 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6213a6e10316d838cbd76b8d6fc5fd5d9d104533
4
- data.tar.gz: 43387a6fa09f80e60b9db3825a0193572e363bf5
3
+ metadata.gz: 34b9b0ba4f4a9e049b9064dad638402684aa2400
4
+ data.tar.gz: 03c0fea3d12cc43f72fe89f5e77303e5b5cea59c
5
5
  SHA512:
6
- metadata.gz: e19c2c94693a7fe60396314d56e2c752a6a87cce94bcc8b64ee5031b3c26a05da4849a71ff2fc6168ca1111d704c65cf5aa968c5b9b84051f705a3adcb01cb86
7
- data.tar.gz: 20cd31dfd04d64fca7e5c53c59017377f670e1026b8c6f9a71891b2fb98853a8433e8a3b2a153f9306b64cc68318d91c292448cc3ae315a6d962c4f61df19a8f
6
+ metadata.gz: 2cb4af4d756d25b75f75f22eb301474d9db50d233ca3c1a1fb986da80ac96ff689de134b90aa1f17688eb2c11f168697e8601c5d631fd89bb1ac71c42f9e6759
7
+ data.tar.gz: 01a4513422e5a72e6d856e77ea1bb9abf7d2e911d31cc33064b3828d3594224ce81a6a40fd3dd3c839cecd264bb654c7e4c50dd164027211f492bc66a76858e8
data/CONTRIBUTORS ADDED
@@ -0,0 +1,21 @@
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
+ * Aaron Mildenstein (untergeek)
6
+ * Bob Corsaro (dokipen)
7
+ * Colin Surprenant (colinsurprenant)
8
+ * Graham Bleach (bleach)
9
+ * Jason Woods (driskell)
10
+ * John E. Vincent (lusis)
11
+ * Jordan Sissel (jordansissel)
12
+ * Kurt Hurtado (kurtado)
13
+ * Pete Fritchman (fetep)
14
+ * Pier-Hugues Pellerin (ph)
15
+ * Richard Pijnenburg (electrical)
16
+ * piavlo
17
+
18
+ Note: If you've sent us patches, bug reports, or otherwise contributed to
19
+ Logstash, and you aren't on the list above and want to be, please let us know
20
+ and we'll make sure you're here. Contributions from folks like you are what make
21
+ open source awesome.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2014 Elasticsearch <http://www.elasticsearch.org>
1
+ Copyright (c) 2012-2015 Elasticsearch <http://www.elasticsearch.org>
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 ADDED
@@ -0,0 +1,95 @@
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.
26
+
27
+ - Install dependencies
28
+ ```sh
29
+ bundle install
30
+ ```
31
+
32
+ #### Test
33
+
34
+ ```sh
35
+ bundle exec rspec
36
+ ```
37
+
38
+ The Logstash code required to run the tests/specs is specified in the `Gemfile` by the line similar to:
39
+ ```ruby
40
+ gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
41
+ ```
42
+ To test against another version or a local Logstash, edit the `Gemfile` to specify an alternative location, for example:
43
+ ```ruby
44
+ gem "logstash", :github => "elasticsearch/logstash", :ref => "master"
45
+ ```
46
+ ```ruby
47
+ gem "logstash", :path => "/your/local/logstash"
48
+ ```
49
+
50
+ Then update your dependencies and run your tests:
51
+
52
+ ```sh
53
+ bundle install
54
+ bundle exec rspec
55
+ ```
56
+
57
+ ### 2. Running your unpublished Plugin in Logstash
58
+
59
+ #### 2.1 Run in a local Logstash clone
60
+
61
+ - Edit Logstash `tools/Gemfile` and add the local plugin path, for example:
62
+ ```ruby
63
+ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
64
+ ```
65
+ - Update Logstash dependencies
66
+ ```sh
67
+ rake vendor:gems
68
+ ```
69
+ - Run Logstash with your plugin
70
+ ```sh
71
+ bin/logstash -e 'filter {awesome {}}'
72
+ ```
73
+ At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
74
+
75
+ #### 2.2 Run in an installed Logstash
76
+
77
+ - Build your plugin gem
78
+ ```sh
79
+ gem build logstash-filter-awesome.gemspec
80
+ ```
81
+ - Install the plugin from the Logstash home
82
+ ```sh
83
+ bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
84
+ ```
85
+ - Start Logstash and proceed to test the plugin
86
+
87
+ ## Contributing
88
+
89
+ All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
90
+
91
+ 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.
92
+
93
+ It is more important to me that you are able to contribute.
94
+
95
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
@@ -5,7 +5,7 @@ require "logstash/namespace"
5
5
 
6
6
  # This input will read events from a Redis instance; it supports both Redis channels and lists.
7
7
  # The list command (BLPOP) used by Logstash is supported in Redis v1.3.1+, and
8
- # the channel commands used by Logstash are found in Redis v1.3.8+.
8
+ # the channel commands used by Logstash are found in Redis v1.3.8+.
9
9
  # While you may be able to make these Redis versions work, the best performance
10
10
  # and stability will be found in more recent stable versions. Versions 2.6.0+
11
11
  # are recommended.
@@ -17,7 +17,6 @@ require "logstash/namespace"
17
17
  #
18
18
  class LogStash::Inputs::Redis < LogStash::Inputs::Threadable
19
19
  config_name "redis"
20
- milestone 2
21
20
 
22
21
  default :codec, "json"
23
22
 
@@ -227,14 +226,11 @@ EOF
227
226
  begin
228
227
  @redis ||= connect
229
228
  self.send listener, @redis, output_queue
230
- rescue Redis::CannotConnectError => e
229
+ rescue Redis::BaseError => e
231
230
  @logger.warn("Redis connection problem", :exception => e)
231
+ # Reset the redis variable to trigger reconnect
232
+ @redis = nil
232
233
  sleep 1
233
- @redis = connect
234
- rescue => e # Redis error
235
- @logger.warn("Failed to get event from Redis", :name => @name,
236
- :exception => e, :backtrace => e.backtrace)
237
- raise e
238
234
  end
239
235
  end # while !finished?
240
236
  end # listener_loop
@@ -252,15 +248,19 @@ EOF
252
248
 
253
249
  public
254
250
  def teardown
255
- if @data_type == 'channel' and @redis
256
- @redis.unsubscribe
257
- @redis.quit
258
- @redis = nil
259
- end
260
- if @data_type == 'pattern_channel' and @redis
261
- @redis.punsubscribe
262
- @redis.quit
263
- @redis = nil
251
+ if @redis
252
+ if @data_type == 'list'
253
+ @redis.quit
254
+ elsif @data_type == 'channel'
255
+ @redis.unsubscribe
256
+ @redis.quit
257
+ elsif @data_type == 'pattern_channel'
258
+ @redis.punsubscribe
259
+ @redis.quit
260
+ end
264
261
  end
262
+ rescue Redis::BaseError
263
+ ensure
264
+ @redis = nil
265
265
  end
266
266
  end # class LogStash::Inputs::Redis
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-redis'
4
- s.version = '0.1.1'
4
+ s.version = '0.1.2'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This input will read events from a Redis instance"
7
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"
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elasticsearch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2015-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - '>='
18
17
  - !ruby/object:Gem::Version
@@ -20,7 +19,10 @@ dependencies:
20
19
  - - <
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.0.0
23
- requirement: !ruby/object:Gem::Requirement
22
+ name: logstash
23
+ prerelease: false
24
+ type: :runtime
25
+ version_requirements: !ruby/object:Gem::Requirement
24
26
  requirements:
25
27
  - - '>='
26
28
  - !ruby/object:Gem::Version
@@ -28,50 +30,48 @@ dependencies:
28
30
  - - <
29
31
  - !ruby/object:Gem::Version
30
32
  version: 2.0.0
31
- prerelease: false
32
- type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
- name: logstash-codec-json
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - '>='
38
- - !ruby/object:Gem::Version
39
- version: '0'
40
34
  requirement: !ruby/object:Gem::Requirement
41
35
  requirements:
42
36
  - - '>='
43
37
  - !ruby/object:Gem::Version
44
38
  version: '0'
39
+ name: logstash-codec-json
45
40
  prerelease: false
46
41
  type: :runtime
47
- - !ruby/object:Gem::Dependency
48
- name: redis
49
42
  version_requirements: !ruby/object:Gem::Requirement
50
43
  requirements:
51
44
  - - '>='
52
45
  - !ruby/object:Gem::Version
53
46
  version: '0'
47
+ - !ruby/object:Gem::Dependency
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
50
  - - '>='
57
51
  - !ruby/object:Gem::Version
58
52
  version: '0'
53
+ name: redis
59
54
  prerelease: false
60
55
  type: :runtime
61
- - !ruby/object:Gem::Dependency
62
- name: logstash-devutils
63
56
  version_requirements: !ruby/object:Gem::Requirement
64
57
  requirements:
65
58
  - - '>='
66
59
  - !ruby/object:Gem::Version
67
60
  version: '0'
61
+ - !ruby/object:Gem::Dependency
68
62
  requirement: !ruby/object:Gem::Requirement
69
63
  requirements:
70
64
  - - '>='
71
65
  - !ruby/object:Gem::Version
72
66
  version: '0'
67
+ name: logstash-devutils
73
68
  prerelease: false
74
69
  type: :development
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
75
  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
76
76
  email: info@elasticsearch.com
77
77
  executables: []
@@ -79,8 +79,10 @@ extensions: []
79
79
  extra_rdoc_files: []
80
80
  files:
81
81
  - .gitignore
82
+ - CONTRIBUTORS
82
83
  - Gemfile
83
84
  - LICENSE
85
+ - README.md
84
86
  - Rakefile
85
87
  - lib/logstash/inputs/redis.rb
86
88
  - logstash-input-redis.gemspec
@@ -107,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
109
  version: '0'
108
110
  requirements: []
109
111
  rubyforge_project:
110
- rubygems_version: 2.2.2
112
+ rubygems_version: 2.1.9
111
113
  signing_key:
112
114
  specification_version: 4
113
115
  summary: This input will read events from a Redis instance