logstash-codec-sflow 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca54b16d12f3edc8d3ef8b37db6558916b571888eb218d9b3ca8388a9f65c97c
4
- data.tar.gz: a6bd63dcdbfea7738673a98af680d7e280a195e6f81a4cedd069160d154a803c
3
+ metadata.gz: d54a85d19735d326c57d665af16294d2de9ec390988425950d5a4469f35b4297
4
+ data.tar.gz: 7cf0f4538e4ebcbc39ce205896b5c4abe75802fed44d9ad38de053c6eea281b4
5
5
  SHA512:
6
- metadata.gz: 513650e06427993a2f0eef196a3f0c9ee4269eac3283e9160846e225b09996c6a9e1e1961f50f99069dc3273e40f7d204ea1c36b1a600fea753b7a2e0c9dd623
7
- data.tar.gz: ba89921055f7996383c8bd075ae771c76728cfb744828e58d064c1c19b98bd1b49ce5d1b82130a21d6535ea14d8f13f755fca289b92858e1d61ab4884b4f685e
6
+ metadata.gz: d51809c141fac97f93650c3c004eef08db60df92fbb5eed283943376593ba9a2cce3a82bf000fc0e648df860af0786dc2b64a14b34b6267776cee031f7d4fded
7
+ data.tar.gz: 1434920b3cbf651711bdfdd5ae87a727d426ae3a9b317d792c77d45ab60976acc53af2cc87314675682509ea9fa280ee510f17c2d32fa57c411fa72d3ec108d4
@@ -36,14 +36,19 @@ class LogStash::Codecs::Sflow < LogStash::Codecs::Base
36
36
  # def initialize
37
37
 
38
38
  def assign_key_value(event, bindata_kv)
39
- unless bindata_kv.nil? or bindata_kv.to_s.eql? ''
40
- bindata_kv.each_pair do |k, v|
39
+ inspection_queue = [bindata_kv]
40
+
41
+ while !inspection_queue.empty?
42
+ kv = inspection_queue.shift()
43
+ if kv.nil? || kv.to_s.eql?('')
44
+ next
45
+ end
46
+
47
+ kv.each_pair do |k, v|
41
48
  if v.is_a?(BinData::Choice)
42
- assign_key_value(event, bindata_kv[k])
43
- else
44
- unless @removed_field.include? k.to_s or v.is_a?(BinData::Array)
45
- event.set("#{k.to_s}", v.to_s)
46
- end
49
+ inspection_queue.push(v)
50
+ elsif !@removed_field.include?(k.to_s) && !v.is_a?(BinData::Array)
51
+ event.set("#{k.to_s}", v.to_s)
47
52
  end
48
53
  end
49
54
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-sflow'
4
- s.version = '2.1.1'
4
+ s.version = '2.1.2'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = 'The sflow codec is for decoding SFlow v5 flows.'
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/plugin install gemname. This gem is not a stand-alone program'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-sflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konrad Zemek
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-06-26 00:00:00.000000000 Z
12
+ date: 2019-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logstash-core-plugin-api