logstash-output-redis-increment 0.2.0 → 0.4.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 +4 -4
- data/lib/logstash/outputs/redis-increment.rb +18 -1
- data/logstash-output-redis-increment.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b10aba9abd87829ca936d416c24c28978bb5790d5fd382677f69286f882248f
|
4
|
+
data.tar.gz: b5039978aac7d26fb12f6f55e68e9e1112452de3fa33657436c6ff2104791880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea0f5d89338356f343c5c0ca735d76672274d90d6cb85bbfe158f7bf6f3f666ffb1a61441b9c28468b535bfc478eede766949a520b055878f14872aef3920edd
|
7
|
+
data.tar.gz: 16c4b642c3b5194681fb2d0e97cf89c28037a0dcb5bdbfd8e9cdd4e5b05c52523ec390b6500df3b48169d0b11d03c433e213397a9fd6d8285ca696d8268303c7
|
@@ -6,6 +6,8 @@ require "logstash/namespace"
|
|
6
6
|
class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
7
7
|
config_name "redis-increment"
|
8
8
|
|
9
|
+
default :codec, "json"
|
10
|
+
|
9
11
|
# The hostname of your Redis server.
|
10
12
|
config :host, :validate => :string, :default => "127.0.0.1:6379"
|
11
13
|
|
@@ -28,10 +30,25 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|
28
30
|
def register
|
29
31
|
require 'redis'
|
30
32
|
@redis = nil
|
33
|
+
@codec.on_event(&method(:send_to_redis))
|
31
34
|
end # def register
|
32
35
|
|
33
36
|
public
|
34
37
|
def receive(event)
|
38
|
+
begin
|
39
|
+
@codec.encode(event)
|
40
|
+
rescue LocalJumpError
|
41
|
+
# This LocalJumpError rescue clause is required to test for regressions
|
42
|
+
# for https://github.com/logstash-plugins/logstash-output-redis/issues/26
|
43
|
+
# see specs. Without it the LocalJumpError is rescued by the StandardError
|
44
|
+
raise
|
45
|
+
rescue StandardError => e
|
46
|
+
@logger.warn("Error encoding event", :exception => e,
|
47
|
+
:event => event)
|
48
|
+
end
|
49
|
+
end # def event
|
50
|
+
|
51
|
+
def send_to_redis(event, payload)
|
35
52
|
begin
|
36
53
|
key = event.sprintf(@key)
|
37
54
|
|
@@ -45,7 +62,7 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|
45
62
|
@redis = nil
|
46
63
|
retry
|
47
64
|
end
|
48
|
-
end #
|
65
|
+
end #def send_to_redis
|
49
66
|
|
50
67
|
private
|
51
68
|
def connect
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-redis-increment'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.4.0'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Logstash Output Plugin for RedisIncrement'
|
6
6
|
s.description = 'Logstash Redis Output plugin for incrementing a key from each event.'
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
# Gem dependencies
|
21
21
|
s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
|
22
|
-
s.add_runtime_dependency 'redis', '
|
22
|
+
s.add_runtime_dependency 'redis', '~> 4'
|
23
23
|
s.add_runtime_dependency "logstash-codec-plain"
|
24
24
|
s.add_development_dependency "logstash-devutils"
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-redis-increment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Vinciguerra
|
@@ -27,17 +27,17 @@ dependencies:
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
|
-
- - "
|
30
|
+
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: '4'
|
33
33
|
name: redis
|
34
34
|
prerelease: false
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|