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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/filters/xml.rb +1 -1
- data/logstash-filter-xml.gemspec +1 -1
- data/spec/filters/xml_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5752546d28d84f25aba5b8938f3554668455b2ba53a20bb2d9d555a32339bc21
|
4
|
+
data.tar.gz: 6f35d6fcf1915907399f5c3254a4f555ded7e3e8e80e3118691ea4aba1d3b922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b567fab011de36e7976dc9939b3d4ae06933d2c5ff56a54c95794c8d25a0f81e29d6aa2b22f459203dd9f9f3f5c30b9e5d750d96aec047f2ca990c66c5d553ea
|
7
|
+
data.tar.gz: 3e5b8fedd5ee99177cf1462487100572aa8a4620985ba89bdf263e0d836b74381735bb919c9892d66d7f09f4323317c85f1e69f7f7a7597770799048cd1059a2
|
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/lib/logstash/filters/xml.rb
CHANGED
@@ -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
|
data/logstash-filter-xml.gemspec
CHANGED
@@ -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.
|
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"
|
data/spec/filters/xml_spec.rb
CHANGED
@@ -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.
|
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:
|
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
|