logstash-filter-xml 4.0.6 → 4.0.7

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: b00b3a1873a98c6e633b1b35bcd64a21eefe8f57fe3c28efcf4103c5a3855685
4
- data.tar.gz: a363f65d3e9f2206221d076b8bfc6c2a4f560e952cb0415c4cea6eb5ab1762b6
3
+ metadata.gz: 5752546d28d84f25aba5b8938f3554668455b2ba53a20bb2d9d555a32339bc21
4
+ data.tar.gz: 6f35d6fcf1915907399f5c3254a4f555ded7e3e8e80e3118691ea4aba1d3b922
5
5
  SHA512:
6
- metadata.gz: '099b6efdb5ad0ea40d18fa91c08a961e8a736cd12df8ee1a07e993c10f8e61dcd3227b7ceb274dc569f24a7417d905f08d607849bcee5005e54c17829d4ed123'
7
- data.tar.gz: e8cede0fb4dc11a5b31aa4bc079ae4ab7b75f112b8acda4be47a582db0cf80120c84d62a40ee856c5264c50cb2bb46e55a0892b3d11e3c2eec97efa0572471a8
6
+ metadata.gz: b567fab011de36e7976dc9939b3d4ae06933d2c5ff56a54c95794c8d25a0f81e29d6aa2b22f459203dd9f9f3f5c30b9e5d750d96aec047f2ca990c66c5d553ea
7
+ data.tar.gz: 3e5b8fedd5ee99177cf1462487100572aa8a4620985ba89bdf263e0d836b74381735bb919c9892d66d7f09f4323317c85f1e69f7f7a7597770799048cd1059a2
@@ -1,3 +1,6 @@
1
+ ## 4.0.7
2
+ - Fixed creation of empty arrays when xpath failed [#59](https://github.com/logstash-plugins/logstash-filter-xml/pull/59)
3
+
1
4
  ## 4.0.6
2
5
  - Fixed force_array behavior with nested elements [#57](https://github.com/logstash-plugins/logstash-filter-xml/pull/57)
3
6
 
@@ -173,7 +173,7 @@ class LogStash::Filters::Xml < LogStash::Filters::Base
173
173
  if data.size == 1 && !@force_array
174
174
  event.set(xpath_dest, data[0])
175
175
  else
176
- event.set(xpath_dest, data)
176
+ event.set(xpath_dest, data) unless data.nil? || data.empty?
177
177
  end
178
178
  end
179
179
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-xml'
4
- s.version = '4.0.6'
4
+ s.version = '4.0.7'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Parses XML into fields"
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"
@@ -401,5 +401,21 @@ describe LogStash::Filters::Xml do
401
401
  insist { subject.get("data") } == { 'x' => { 'content' => 'text1' }, 'y' => { 'a' => '2', 'content' => 'text2' } }
402
402
  end
403
403
  end
404
+ describe "does not set empty array event on failed xpath" do
405
+ config <<-CONFIG
406
+ filter {
407
+ xml {
408
+ source => "xmldata"
409
+ target => "data"
410
+ xpath => [ "//foo/text()","xpath_field" ]
411
+ }
412
+ }
413
+ CONFIG
414
+
415
+ sample("raw" => '<foobar></foobar>') do
416
+ insist { subject.get("tags") }.nil?
417
+ insist { subject.get("xpath_field")}.nil?
418
+ end
419
+ end
404
420
  end
405
421
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.6
4
+ version: 4.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-06 00:00:00.000000000 Z
11
+ date: 2019-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement