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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09f5841ef5cea04c67fbd4d8b663ac24ddb14c3e
4
- data.tar.gz: 242de618b14b909e944d36e5b4a954fa08971c0a
3
+ metadata.gz: fdf8958f03c4c705a898af1a379efe5efb73114f
4
+ data.tar.gz: 484ed50209c217bbee111b727cef713bb851cbcb
5
5
  SHA512:
6
- metadata.gz: 2a157b25fffe60d2d476da4a6ccb35d3d266f9cdb4d864d3050cb95eef3f35c3718c54319fa57b93465b310e6dccf62d0665425e022f2cbdb4ddf02c0476077e
7
- data.tar.gz: 4a2156032de0bde583523ea0184c506621cb331b4b09e7eea68b468e2782236d41990302641759dd8e42a522d50ad60a017309bc3237974946b6323561e9c819
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
- # nothing needed
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
- map = @memorized[@stream_identity]
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
- end
66
- if !val.nil?
66
+ else
67
67
  event[field] = val
68
68
  any = true
69
- end
69
+ end
70
70
  else
71
- map = @memorized[@stream_identity]
72
- if map.nil?
73
- map = @memorized[@stream_identity] = Hash.new
74
- end
75
- val = event[field]
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.0'
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.0
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-06-04 00:00:00.000000000 Z
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