logstash-output-redis-increment 0.4.0 → 0.5.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 +17 -18
- 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: 7e2735b41ece2a0179056d8641c59efd44a41595ad676e593b294316632477bf
|
4
|
+
data.tar.gz: e3e63dc6a6b81283b66d057afd28cc438965cb90426e2240ca230c1089f48eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a53c4e1ca1bc9cc5090ba33a26a4629416ec14da5b87658b4ed13cfea4d11b778440851240836eb826868657bec2a6e1a5a74eb2e64a6e235b5730826192d7a
|
7
|
+
data.tar.gz: c8a3a4edfe204bee81d350510ad9282c15990d3e4091752085622b8fdd74d13cf531941c699099f7536a1c1b8a201e8fd1fdee615c0c364876efc55fa1dbf30b
|
@@ -48,25 +48,9 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|
48
48
|
end
|
49
49
|
end # def event
|
50
50
|
|
51
|
-
def send_to_redis(event, payload)
|
52
|
-
begin
|
53
|
-
key = event.sprintf(@key)
|
54
|
-
|
55
|
-
@redis ||= connect
|
56
|
-
@redis.incr(key)
|
57
|
-
rescue => e
|
58
|
-
@logger.warn("Failed to increment event to Redis", :event => event,
|
59
|
-
:identity => identity, :exception => e,
|
60
|
-
:backtrace => e.backtrace)
|
61
|
-
sleep @reconnect_interval
|
62
|
-
@redis = nil
|
63
|
-
retry
|
64
|
-
end
|
65
|
-
end #def send_to_redis
|
66
|
-
|
67
51
|
private
|
68
52
|
def connect
|
69
|
-
@current_host, @current_port = @host
|
53
|
+
@current_host, @current_port = @host.split(':')
|
70
54
|
params = {
|
71
55
|
:host => @current_host,
|
72
56
|
:port => @current_port,
|
@@ -80,10 +64,25 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|
80
64
|
end
|
81
65
|
|
82
66
|
Redis.new(params)
|
83
|
-
end
|
67
|
+
end #def connect
|
84
68
|
|
85
69
|
# A string used to identify a Redis instance in log messages
|
86
70
|
def identity
|
87
71
|
"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@key}"
|
88
72
|
end
|
73
|
+
|
74
|
+
def send_to_redis(event, payload)
|
75
|
+
key = event.sprintf(@key)
|
76
|
+
begin
|
77
|
+
@redis ||= connect
|
78
|
+
@redis.incr(key)
|
79
|
+
rescue => e
|
80
|
+
@logger.warn("Failed to increment event to Redis", :event => event,
|
81
|
+
:identity => identity, :exception => e,
|
82
|
+
:backtrace => e.backtrace)
|
83
|
+
sleep @reconnect_interval
|
84
|
+
@redis = nil
|
85
|
+
retry
|
86
|
+
end
|
87
|
+
end #def send_to_redis
|
89
88
|
end # class LogStash::Outputs::Redis
|
@@ -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.5.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.'
|