logstash-filter-redis 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
  SHA1:
3
- metadata.gz: 380ebbff9adc91207fe0fad3aa9818e11378cc45
4
- data.tar.gz: 6377159bf5e178ba6e68d91a4a02c062581ca170
3
+ metadata.gz: c97796608b3db273ee2e5dbcfd5d3138c93d4030
4
+ data.tar.gz: 307a47ff45dd3a300860fca70dcc65cb5f5ebff1
5
5
  SHA512:
6
- metadata.gz: 8d934621faec917dfc1f2ab4e21a472e01f94b6e95ad5ca23a81cd073790764878abe6581dbcf16cab1afd72c50ae304b9b534ea7820c6cd96a4dd8d8626eeaf
7
- data.tar.gz: 062615bbd46143c35b5c786a8cb48e166d6c85dd7adad450c18342fd6399e9cf0eb9c2716bc5a391a9fe4c36c10881878d6cb0f4c2f4310326e0e8dd53cb5db8
6
+ metadata.gz: f213306e13f0349c94bd209c8e3dde6501aebf431a9a04e7e093cfe499b7a26ebb755478e21b4f1e372261fe2d5fa1f26f0a7b0972650c2e17bd6a0b40379129
7
+ data.tar.gz: 0bc86d0b5eb63b243142b457b0236b6c1159ae75520fa945c2dcefc8b71fa9f14b5ec931fc65452bbe6d675104f4253b9eebc8768e58be1bb826da4f5b8dacb1
@@ -78,17 +78,18 @@ class LogStash::Filters::Redis < LogStash::Filters::Base
78
78
  return unless event.include?(@field)
79
79
  return if event.include?(@destination) and not @override
80
80
 
81
- source = event[@field].is_a?(Array) ? event[@field].first.to_s : event[@field].to_s
81
+ source = event.get(@field).is_a?(Array) ? event.get(@field).first.to_s : event.get(@field).to_s
82
82
  @redis ||= connect
83
83
  val = @redis.get(source)
84
84
  if val
85
85
  begin
86
- event[@destination] = JSON.parse(val)
86
+ event.set(@destination, JSON.parse(val))
87
87
  rescue JSON::ParserError => e
88
- event[@destination] = val
88
+ event.set(@destination, val)
89
+ #event.set("redis-error", "Cannot parse JSON: " + e.to_s)
89
90
  end
90
91
  elsif @fallback
91
- event[@destination] = @fallback
92
+ event.set(@destination, @fallback)
92
93
  end
93
94
 
94
95
  # filter_matched should go in the last line of our successful code
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-redis'
4
- s.version = '0.2.0'
4
+ s.version = '0.3.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This filter allows the storage of event fields in a redis key to be retrieved by a later event"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -20,9 +20,10 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24
+ #s.add_runtime_dependency "logstash-core-plugin-api", "= 2.1.16"
24
25
  s.add_runtime_dependency "redis", '>= 3.0.0', '< 4.0.0'
25
26
 
26
- s.add_development_dependency 'logstash-devutils'
27
+ s.add_development_dependency 'logstash-devutils', "= 1.1.0"
27
28
  end
28
29
 
@@ -22,7 +22,7 @@ describe LogStash::Filters::Redis do
22
22
  CONFIG
23
23
 
24
24
  sample({"message" => "Test message", "redis-key" => "somekey"}) do
25
- insist { subject["redis-value"] } == "somevalue"
25
+ insist { subject.get("redis-value") } == "somevalue"
26
26
  insist { @redis.get("somekey") } == "somevalue"
27
27
  end
28
28
  end
@@ -38,7 +38,7 @@ describe LogStash::Filters::Redis do
38
38
  CONFIG
39
39
 
40
40
  sample({"message" => "Test message", "redis-key" => "somekey"}) do
41
- insist { subject["redis-value"] } == "somevalue"
41
+ insist { subject.get("redis-value") } == "somevalue"
42
42
  insist { @redis.get("somekey") } == "somevalue"
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-redis
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
  - meulop
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-07 00:00:00.000000000 Z
12
+ date: 2016-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.60'
20
+ - - "<="
18
21
  - !ruby/object:Gem::Version
19
- version: '1.0'
22
+ version: '2.99'
20
23
  name: logstash-core-plugin-api
21
24
  prerelease: false
22
25
  type: :runtime
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
- version: '1.0'
30
+ version: '1.60'
31
+ - - "<="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.99'
28
34
  - !ruby/object:Gem::Dependency
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
@@ -48,17 +54,17 @@ dependencies:
48
54
  - !ruby/object:Gem::Dependency
49
55
  requirement: !ruby/object:Gem::Requirement
50
56
  requirements:
51
- - - ">="
57
+ - - '='
52
58
  - !ruby/object:Gem::Version
53
- version: '0'
59
+ version: 1.1.0
54
60
  name: logstash-devutils
55
61
  prerelease: false
56
62
  type: :development
57
63
  version_requirements: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - ">="
65
+ - - '='
60
66
  - !ruby/object:Gem::Version
61
- version: '0'
67
+ version: 1.1.0
62
68
  description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
63
69
  email: markus.paaso@gmail.com
64
70
  executables: []
@@ -97,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
103
  version: '0'
98
104
  requirements: []
99
105
  rubyforge_project:
100
- rubygems_version: 2.4.8
106
+ rubygems_version: 2.6.6
101
107
  signing_key:
102
108
  specification_version: 4
103
109
  summary: This filter allows the storage of event fields in a redis key to be retrieved by a later event