logstash-filter-memorize 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/filters/memorize.rb +10 -11
- data/logstash-filter-memorize.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdf8958f03c4c705a898af1a379efe5efb73114f
|
4
|
+
data.tar.gz: 484ed50209c217bbee111b727cef713bb851cbcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b74b59607c0766051c58612cb8c2c377e65cc1f482d45f88da3df2f8332785642985040ef462f4322611ba1d3fc29f31ce233299545ff3ee23f88a4050c52a0c
|
7
|
+
data.tar.gz: bfef5b983a53fc1a650f8bb4c9129bd13f7a177b386760e23c98d2d5e5d7a04a93277e6c9435d7af78be3140a82be0d79a6c749c257e51f2755cd7772461f85a
|
@@ -48,7 +48,7 @@ class LogStash::Filters::Memorize < LogStash::Filters::Base
|
|
48
48
|
|
49
49
|
public
|
50
50
|
def register
|
51
|
-
|
51
|
+
# nothing needed
|
52
52
|
end # def register
|
53
53
|
|
54
54
|
public
|
@@ -56,24 +56,23 @@ class LogStash::Filters::Memorize < LogStash::Filters::Base
|
|
56
56
|
return unless filter?(event)
|
57
57
|
|
58
58
|
any = false
|
59
|
+
key = event.sprintf(@stream_identity)
|
59
60
|
@fields.each do |field|
|
60
61
|
if event[field].nil?
|
61
|
-
|
62
|
+
map = @memorized[key]
|
62
63
|
val = map.nil? ? nil : map[field]
|
63
64
|
if val.nil?
|
64
65
|
val = @default.nil? ? nil : @default[field]
|
65
|
-
|
66
|
-
if !val.nil?
|
66
|
+
else
|
67
67
|
event[field] = val
|
68
68
|
any = true
|
69
|
-
|
69
|
+
end
|
70
70
|
else
|
71
|
-
map = @memorized[
|
72
|
-
|
73
|
-
map = @memorized[
|
74
|
-
|
75
|
-
|
76
|
-
map[field] = event[field]
|
71
|
+
map = @memorized[key]
|
72
|
+
if map.nil?
|
73
|
+
map = @memorized[key] = Hash.new
|
74
|
+
end
|
75
|
+
map[field] = event[field]
|
77
76
|
end #if
|
78
77
|
if any
|
79
78
|
filter_matched(event)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-memorize'
|
3
|
-
s.version = '0.9.
|
3
|
+
s.version = '0.9.1'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "The memorize filter is able to pick out details of an event and use that information in future events if it is not present."
|
6
6
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-memorize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Caldwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|