logstash-output-redis-increment 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/outputs/redis-increment.rb +18 -1
- data/logstash-output-redis-increment.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed05f57930d8b247faae8365d1bc5026a4bb5952c1fe2b0df97340afeb034e96
|
4
|
+
data.tar.gz: 7767802d9b9cdc8e85c8a10ae7a6b4d3757037b26b892365044c4bd17b567153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2117f6b484c5178bd8ef2e20482920a9b0bba629e8de7d1ff01a39ca5b2c06ee4afc39055e9e4b38be14876c5b5312cad2a0baa4c209335485a812dcea3847ad
|
7
|
+
data.tar.gz: f478c961561ab131c649e58e2d05cb6d1207e5199f4b6009fb4858bf7f4de189a3815052d98949c9953e0fe4c7914107c413c8b80e0dded4925d01123da18f73
|
@@ -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.3.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.'
|