logstash-filter-xml 2.1.3 → 2.1.4

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
  SHA1:
3
- metadata.gz: aa0cd358f103b421ffb2039b0b1bb72ba3c79caf
4
- data.tar.gz: 8735d06b2b5da663cf0f011b0b9eef52bb19a480
3
+ metadata.gz: 0bbe7a26079ee72f9c7ff4a22f793757f798d664
4
+ data.tar.gz: 463335a351bae555a468961e02f8bd2e06757552
5
5
  SHA512:
6
- metadata.gz: b7adefb6e41f38b3f16d142c4e26ec4f4edcddc68793f82e6e897975449068c5c148865a036ec780256740a9c3452be9016ed7ac05d49d1509b80e41d4a7b4e5
7
- data.tar.gz: b36c4eca3db78a7d033e9985bba70476c67fc27b84febe6b4e253891fd8534ae7cc1cadaf1ec46883e08dd66383148ced093d13caf5bc4631a6faa8347dcf10e
6
+ metadata.gz: 895e1fabb1950929973a761d0c3899e5cfe6854b2c0a1b71184b75260fe10167c52a0e8d4b1a1b176a39d3b3b695b58ea8dfaf42dc68cc1ffc45d4e49b0ffd82
7
+ data.tar.gz: ef8a46d212ede4351ffcbf62f562dff080557279530e7cfa432f827a3d8afb7dd4c0fe47f6b314c5392e08c40f3e70728b53a391398c37e5efd41752cd27f5ef
@@ -1,3 +1,5 @@
1
+ # 2.1.4
2
+ - Added setting to disable forcing single values to be added in arrays. Ref: https://github.com/logstash-plugins/logstash-filter-xml/pull/28.
1
3
  # 2.1.3
2
4
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
5
  # 2.1.2
@@ -10,6 +10,7 @@ Contributors:
10
10
  * Pier-Hugues Pellerin (ph)
11
11
  * Richard Pijnenburg (electrical)
12
12
  * Suyog Rao (suyograo)
13
+ * Gabriel Moskovicz (gmoskovicz)
13
14
 
14
15
  Note: If you've sent us patches, bug reports, or otherwise contributed to
15
16
  Logstash, and you aren't on the list above and want to be, please let us know
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Build
4
- Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-xml-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-xml-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-xml.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-xml)
5
4
 
6
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
7
6
 
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
56
55
  ```
57
56
  - Install plugin
58
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
59
62
  bin/plugin install --no-verify
63
+
60
64
  ```
61
65
  - Run Logstash with your plugin
62
66
  ```sh
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
74
78
  ```
75
79
  - Install the plugin from the Logstash home
76
80
  ```sh
77
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
78
87
  ```
79
88
  - Start Logstash and proceed to test the plugin
80
89
 
@@ -62,6 +62,10 @@ class LogStash::Filters::Xml < LogStash::Filters::Base
62
62
  # field as described above. Setting this to false will prevent that.
63
63
  config :store_xml, :validate => :boolean, :default => true
64
64
 
65
+ # By default the filter will force single elements to be arrays. Setting this to
66
+ # false will prevent storing single elements in arrays.
67
+ config :force_array, :validate => :boolean, :default => true
68
+
65
69
  # By default only namespaces declarations on the root element are considered.
66
70
  # This allows to configure all namespace declarations to parse the XML document.
67
71
  #
@@ -159,7 +163,7 @@ class LogStash::Filters::Xml < LogStash::Filters::Base
159
163
 
160
164
  if @store_xml
161
165
  begin
162
- event[@target] = XmlSimple.xml_in(value)
166
+ event[@target] = XmlSimple.xml_in(value, "ForceArray" => @force_array)
163
167
  matched = true
164
168
  rescue => e
165
169
  event.tag(XMLPARSEFAILURE_TAG)
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-xml'
4
- s.version = '2.1.3'
4
+ s.version = '2.1.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Takes a field that contains XML and expands it into an actual datastructure."
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"
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"
8
8
  s.authors = ["Elastic"]
9
9
  s.email = 'info@elastic.co'
10
10
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
@@ -272,4 +272,38 @@ describe LogStash::Filters::Xml do
272
272
  end
273
273
  end
274
274
 
275
+
276
+ describe "parse with forcing array (Default)" do
277
+ config <<-CONFIG
278
+ filter {
279
+ xml {
280
+ source => "xmldata"
281
+ target => "parseddata"
282
+ }
283
+ }
284
+ CONFIG
285
+
286
+ # Single value
287
+ sample("xmldata" => '<foo><bar>Content</bar></foo>') do
288
+ insist { subject["parseddata"] } == { "bar" => ["Content"] }
289
+ end
290
+ end
291
+
292
+ describe "parse disabling forcing array" do
293
+ config <<-CONFIG
294
+ filter {
295
+ xml {
296
+ source => "xmldata"
297
+ target => "parseddata"
298
+ force_array => false
299
+ }
300
+ }
301
+ CONFIG
302
+
303
+ # Single value
304
+ sample("xmldata" => '<foo><bar>Content</bar></foo>') do
305
+ insist { subject["parseddata"] } == { "bar" => "Content" }
306
+ end
307
+ end
308
+
275
309
  end
metadata CHANGED
@@ -1,72 +1,72 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
14
20
  requirement: !ruby/object:Gem::Requirement
15
21
  requirements:
16
- - - "~>"
22
+ - - ~>
17
23
  - !ruby/object:Gem::Version
18
24
  version: '1.0'
19
- name: logstash-core-plugin-api
20
25
  prerelease: false
21
26
  type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
22
29
  version_requirements: !ruby/object:Gem::Requirement
23
30
  requirements:
24
- - - "~>"
31
+ - - '>='
25
32
  - !ruby/object:Gem::Version
26
- version: '1.0'
27
- - !ruby/object:Gem::Dependency
33
+ version: '0'
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
30
- - - ">="
36
+ - - '>='
31
37
  - !ruby/object:Gem::Version
32
38
  version: '0'
33
- name: nokogiri
34
39
  prerelease: false
35
40
  type: :runtime
41
+ - !ruby/object:Gem::Dependency
42
+ name: xml-simple
36
43
  version_requirements: !ruby/object:Gem::Requirement
37
44
  requirements:
38
- - - ">="
45
+ - - '>='
39
46
  - !ruby/object:Gem::Version
40
47
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
48
  requirement: !ruby/object:Gem::Requirement
43
49
  requirements:
44
- - - ">="
50
+ - - '>='
45
51
  - !ruby/object:Gem::Version
46
52
  version: '0'
47
- name: xml-simple
48
53
  prerelease: false
49
54
  type: :runtime
55
+ - !ruby/object:Gem::Dependency
56
+ name: logstash-devutils
50
57
  version_requirements: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ">="
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
62
  requirement: !ruby/object:Gem::Requirement
57
63
  requirements:
58
- - - ">="
64
+ - - '>='
59
65
  - !ruby/object:Gem::Version
60
66
  version: '0'
61
- name: logstash-devutils
62
67
  prerelease: false
63
68
  type: :development
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- 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
69
+ 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
70
70
  email: info@elastic.co
71
71
  executables: []
72
72
  extensions: []
@@ -93,12 +93,12 @@ require_paths:
93
93
  - lib
94
94
  required_ruby_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ">="
96
+ - - '>='
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []