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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edd15c1bef103974a1fc46b569c298f1de64d3da1ee63d4b0e1a345efefad250
4
- data.tar.gz: 6772914f6b1005dbe34f37746001062d1f90d30a0c96e3ecbed236adafeb3d6d
3
+ metadata.gz: ed05f57930d8b247faae8365d1bc5026a4bb5952c1fe2b0df97340afeb034e96
4
+ data.tar.gz: 7767802d9b9cdc8e85c8a10ae7a6b4d3757037b26b892365044c4bd17b567153
5
5
  SHA512:
6
- metadata.gz: '03981bcaf1f01158f86b8eba04e9c1662dba3533ab608d30f3dcafc8ebb8c2898fa6e8b051897443623037fe0868c971d767f0639e3bdcc2be8cba31f9d1ec67'
7
- data.tar.gz: b15d475347bab40518690d049d1bc296c8e674f22e4f75f28139efa70971d085fadc52abc144401ce6900f2dfb7c025fe2f11103a44bf6ce3eb2b42529464d0c
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 # def event
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.2.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.'
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Vinciguerra