logstash-output-redis 2.0.5 → 3.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: e5521e16c30f64515f0280b3dac67304d69704a0
4
- data.tar.gz: 0cdffaddc9e1d3347be833351cb6a31981061174
3
+ metadata.gz: c5c13509cbc26b9035d72338d3d6574c13182101
4
+ data.tar.gz: 58926f84596b131fa5edf89284a2df9e1c9ad1f8
5
5
  SHA512:
6
- metadata.gz: 7e489069572645b18d6db062d0cf4712ac4087d92fa88b5c54b9f78485407085bd18bc4cca54a15de908ed6657b5a37596dce2f11fa5805acb7de2a64d4882ec
7
- data.tar.gz: b398711520f6e4667f5c18a487c6efeea300058152c6b31bf7b659bbd85a5ec7c6ac6c0e90feba3ec0c1024191579ffd067c7b2053c5b516e54e4b96f10fdac8
6
+ metadata.gz: 5b141ab3cf820d2d63f93491d97da8a8f28d0ea4ab7cac6315f5a8165e1e686bc1ee01c2a8276183a5fa6360e728e30db1d1c22090675f71a6d27f02267b921c
7
+ data.tar.gz: 8e478f47e1b6227b244452291c0d1b41c427be79b383679faa7694dca05697ecec55a8d6b69d248b6be330b3e83ec51ea0c62578c727e31c4fff3617ca38959e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## 3.0.0
2
+ - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
1
3
  # 2.0.5
2
4
  - Fix LocalJumpError exception see https://github.com/logstash-plugins/logstash-output-redis/pull/27
3
5
  # 2.0.4
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
2
+
3
+ # Specify your gem's dependencies in logstash-mass_effect.gemspec
4
+ gemspec
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
@@ -55,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
55
55
  ```
56
56
  - Install plugin
57
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
58
62
  bin/plugin install --no-verify
63
+
59
64
  ```
60
65
  - Run Logstash with your plugin
61
66
  ```sh
@@ -73,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
73
78
  ```
74
79
  - Install the plugin from the Logstash home
75
80
  ```sh
76
- 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
+
77
87
  ```
78
88
  - Start Logstash and proceed to test the plugin
79
89
 
@@ -21,7 +21,6 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
21
21
  default :codec, "json"
22
22
 
23
23
  # Name is used for logging in case there are multiple instances.
24
- # TODO: delete
25
24
  config :name, :validate => :string, :default => 'default',
26
25
  :deprecated => true
27
26
 
@@ -52,17 +51,14 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
52
51
 
53
52
  # The name of the Redis queue (we'll use RPUSH on this). Dynamic names are
54
53
  # valid here, for example `logstash-%{type}`
55
- # TODO: delete
56
54
  config :queue, :validate => :string, :deprecated => true
57
55
 
58
56
  # The name of a Redis list or channel. Dynamic names are
59
57
  # valid here, for example `logstash-%{type}`.
60
- # TODO set required true
61
58
  config :key, :validate => :string, :required => false
62
59
 
63
60
  # Either list or channel. If `redis_type` is list, then we will set
64
61
  # RPUSH to key. If `redis_type` is channel, then we will PUBLISH to `key`.
65
- # TODO set required true
66
62
  config :data_type, :validate => [ "list", "channel" ], :required => false
67
63
 
68
64
  # Set to true if you want Redis to batch up values and send 1 RPUSH command
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-redis'
4
- s.version = '2.0.5'
4
+ s.version = '3.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This output will send events to a Redis queue using RPUSH"
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"
7
+ 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
8
  s.authors = ["Elastic"]
9
9
  s.email = 'info@elastic.co'
10
10
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
24
24
 
25
25
  s.add_runtime_dependency 'redis'
26
26
  s.add_runtime_dependency 'stud'
@@ -6,7 +6,7 @@ require "flores/random"
6
6
 
7
7
  describe LogStash::Outputs::Redis do
8
8
 
9
- context "integration tests", :redis => true do
9
+ context "integration tests", :integration => true do
10
10
  shared_examples_for "writing to redis list" do |extra_config|
11
11
  let(:key) { 10.times.collect { rand(10).to_s }.join("") }
12
12
  let(:event_count) { Flores::Random.integer(0..10000) }
@@ -42,8 +42,8 @@ describe LogStash::Outputs::Redis do
42
42
  event_count.times do |value|
43
43
  id, element = redis.blpop(key, 0)
44
44
  event = LogStash::Event.new(LogStash::Json.load(element))
45
- insist { event["sequence"] } == value
46
- insist { event["message"] } == message
45
+ insist { event.get("sequence") } == value
46
+ insist { event.get("message") } == message
47
47
  end
48
48
 
49
49
  # The list should now be empty
@@ -73,36 +73,5 @@ describe LogStash::Outputs::Redis do
73
73
  end
74
74
  end
75
75
  end
76
-
77
- context "Redis#receive in batch mode" do
78
- # this is a regression test harness to verify fix for https://github.com/logstash-plugins/logstash-output-redis/issues/26
79
- # TODO: refactor specs above and probably rely on a Redis mock to correctly test the code expected behaviour, the actual
80
- # tests agains Redis should be moved into integration tests.
81
- let(:key) { "thekey" }
82
- let(:payload) { "somepayload"}
83
- let(:event) { LogStash::Event.new({"message" => "test"}) }
84
- let(:config) {
85
- {
86
- "key" => key,
87
- "data_type" => "list",
88
- "batch" => true,
89
- "batch_events" => 50,
90
- }
91
- }
92
- let(:redis) { described_class.new(config) }
93
-
94
- it "should call buffer_receive" do
95
- redis.register
96
- expect(redis).to receive(:buffer_receive).exactly(10000).times.and_call_original
97
- expect(redis).to receive(:flush).exactly(200).times
98
-
99
- # I was able to reproduce the LocalJumpError: unexpected next exception at around 50
100
- # consicutive invocations. setting to 10000 should reproduce it for any environment
101
- # I have no clue at this point why this problem does not happen at every invocation
102
- 1.upto(10000) do
103
- expect{redis.receive(event)}.to_not raise_error
104
- end
105
- end
106
- end
107
76
  end
108
77
 
@@ -0,0 +1,40 @@
1
+ require "logstash/devutils/rspec/spec_helper"
2
+ require "logstash/outputs/redis"
3
+ require "logstash/json"
4
+ require "redis"
5
+ require "flores/random"
6
+
7
+ describe LogStash::Outputs::Redis do
8
+
9
+ context "Redis#receive in batch mode" do
10
+ # this is a regression test harness to verify fix for https://github.com/logstash-plugins/logstash-output-redis/issues/26
11
+ # TODO: refactor specs above and probably rely on a Redis mock to correctly test the code expected behaviour, the actual
12
+ # tests agains Redis should be moved into integration tests.
13
+ let(:key) { "thekey" }
14
+ let(:payload) { "somepayload"}
15
+ let(:event) { LogStash::Event.new({"message" => "test"}) }
16
+ let(:config) {
17
+ {
18
+ "key" => key,
19
+ "data_type" => "list",
20
+ "batch" => true,
21
+ "batch_events" => 50,
22
+ }
23
+ }
24
+ let(:redis) { described_class.new(config) }
25
+
26
+ it "should call buffer_receive" do
27
+ redis.register
28
+ expect(redis).to receive(:buffer_receive).exactly(10000).times.and_call_original
29
+ expect(redis).to receive(:flush).exactly(200).times
30
+
31
+ # I was able to reproduce the LocalJumpError: unexpected next exception at around 50
32
+ # consicutive invocations. setting to 10000 should reproduce it for any environment
33
+ # I have no clue at this point why this problem does not happen at every invocation
34
+ 1.upto(10000) do
35
+ expect{redis.receive(event)}.to_not raise_error
36
+ end
37
+ end
38
+ end
39
+ end
40
+
metadata CHANGED
@@ -1,114 +1,116 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-14 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
15
  requirement: !ruby/object:Gem::Requirement
21
16
  requirements:
22
- - - ~>
17
+ - - "~>"
23
18
  - !ruby/object:Gem::Version
24
- version: '1.0'
25
- prerelease: false
19
+ version: '2.0'
26
20
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
- name: redis
21
+ prerelease: false
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - '>='
24
+ - - "~>"
32
25
  - !ruby/object:Gem::Version
33
- version: '0'
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redis
34
29
  requirement: !ruby/object:Gem::Requirement
35
30
  requirements:
36
- - - '>='
31
+ - - ">="
37
32
  - !ruby/object:Gem::Version
38
33
  version: '0'
39
- prerelease: false
40
34
  type: :runtime
41
- - !ruby/object:Gem::Dependency
42
- name: stud
35
+ prerelease: false
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - '>='
38
+ - - ">="
46
39
  - !ruby/object:Gem::Version
47
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: stud
48
43
  requirement: !ruby/object:Gem::Requirement
49
44
  requirements:
50
- - - '>='
45
+ - - ">="
51
46
  - !ruby/object:Gem::Version
52
47
  version: '0'
53
- prerelease: false
54
48
  type: :runtime
55
- - !ruby/object:Gem::Dependency
56
- name: logstash-devutils
49
+ prerelease: false
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
51
  requirements:
59
- - - '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: logstash-devutils
62
57
  requirement: !ruby/object:Gem::Requirement
63
58
  requirements:
64
- - - '>='
59
+ - - ">="
65
60
  - !ruby/object:Gem::Version
66
61
  version: '0'
67
- prerelease: false
68
62
  type: :development
69
- - !ruby/object:Gem::Dependency
70
- name: logstash-input-generator
63
+ prerelease: false
71
64
  version_requirements: !ruby/object:Gem::Requirement
72
65
  requirements:
73
- - - '>='
66
+ - - ">="
74
67
  - !ruby/object:Gem::Version
75
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: logstash-input-generator
76
71
  requirement: !ruby/object:Gem::Requirement
77
72
  requirements:
78
- - - '>='
73
+ - - ">="
79
74
  - !ruby/object:Gem::Version
80
75
  version: '0'
81
- prerelease: false
82
76
  type: :development
83
- - !ruby/object:Gem::Dependency
84
- name: logstash-codec-json
77
+ prerelease: false
85
78
  version_requirements: !ruby/object:Gem::Requirement
86
79
  requirements:
87
- - - '>='
80
+ - - ">="
88
81
  - !ruby/object:Gem::Version
89
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: logstash-codec-json
90
85
  requirement: !ruby/object:Gem::Requirement
91
86
  requirements:
92
- - - '>='
87
+ - - ">="
93
88
  - !ruby/object:Gem::Version
94
89
  version: '0'
95
- prerelease: false
96
90
  type: :development
97
- - !ruby/object:Gem::Dependency
98
- name: flores
91
+ prerelease: false
99
92
  version_requirements: !ruby/object:Gem::Requirement
100
93
  requirements:
101
- - - '>='
94
+ - - ">="
102
95
  - !ruby/object:Gem::Version
103
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: flores
104
99
  requirement: !ruby/object:Gem::Requirement
105
100
  requirements:
106
- - - '>='
101
+ - - ">="
107
102
  - !ruby/object:Gem::Version
108
103
  version: '0'
109
- prerelease: false
110
104
  type: :development
111
- 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
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: This gem is a Logstash plugin required to be installed on top of the
112
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
113
+ gem is not a stand-alone program
112
114
  email: info@elastic.co
113
115
  executables: []
114
116
  extensions: []
@@ -122,32 +124,34 @@ files:
122
124
  - README.md
123
125
  - lib/logstash/outputs/redis.rb
124
126
  - logstash-output-redis.gemspec
125
- - spec/outputs/redis_spec.rb
127
+ - spec/integration/outputs/redis_spec.rb
128
+ - spec/unit/outputs/redis_spec.rb
126
129
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
127
130
  licenses:
128
131
  - Apache License (2.0)
129
132
  metadata:
130
133
  logstash_plugin: 'true'
131
134
  logstash_group: output
132
- post_install_message:
135
+ post_install_message:
133
136
  rdoc_options: []
134
137
  require_paths:
135
138
  - lib
136
139
  required_ruby_version: !ruby/object:Gem::Requirement
137
140
  requirements:
138
- - - '>='
141
+ - - ">="
139
142
  - !ruby/object:Gem::Version
140
143
  version: '0'
141
144
  required_rubygems_version: !ruby/object:Gem::Requirement
142
145
  requirements:
143
- - - '>='
146
+ - - ">="
144
147
  - !ruby/object:Gem::Version
145
148
  version: '0'
146
149
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.4.8
149
- signing_key:
150
+ rubyforge_project:
151
+ rubygems_version: 2.5.1
152
+ signing_key:
150
153
  specification_version: 4
151
154
  summary: This output will send events to a Redis queue using RPUSH
152
155
  test_files:
153
- - spec/outputs/redis_spec.rb
156
+ - spec/integration/outputs/redis_spec.rb
157
+ - spec/unit/outputs/redis_spec.rb