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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b10aba9abd87829ca936d416c24c28978bb5790d5fd382677f69286f882248f
4
- data.tar.gz: b5039978aac7d26fb12f6f55e68e9e1112452de3fa33657436c6ff2104791880
3
+ metadata.gz: 7e2735b41ece2a0179056d8641c59efd44a41595ad676e593b294316632477bf
4
+ data.tar.gz: e3e63dc6a6b81283b66d057afd28cc438965cb90426e2240ca230c1089f48eb1
5
5
  SHA512:
6
- metadata.gz: ea0f5d89338356f343c5c0ca735d76672274d90d6cb85bbfe158f7bf6f3f666ffb1a61441b9c28468b535bfc478eede766949a520b055878f14872aef3920edd
7
- data.tar.gz: 16c4b642c3b5194681fb2d0e97cf89c28037a0dcb5bdbfd8e9cdd4e5b05c52523ec390b6500df3b48169d0b11d03c433e213397a9fd6d8285ca696d8268303c7
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[@host_idx].split(':')
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.4.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.'
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.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Vinciguerra