logstash-filter-csv 2.1.3 → 3.0.0

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: ee185179668de51ee3ae43488d365ad1e6dfa2ed
4
- data.tar.gz: 05925e603b41559122738a5bd1c40add74b8eec5
3
+ metadata.gz: 4429289ac57b4af0203b4e25f2afaf8af49c60d3
4
+ data.tar.gz: c985828193852bf22d0892970eedf6b2af1a0046
5
5
  SHA512:
6
- metadata.gz: 6d32ae8c759c0cdaf74e2305c965eb73db7b552ae1af5aa86c393d1dcf7b610ec3c18ceb7a71fff32c08e2c858d989c48c1200d6c785e5ceb1b357f788c81f50
7
- data.tar.gz: 9d5d6ed180c31a68e58fab1a66813aabf68bd59132c8e56ee9341d376a8f7fc80baac2e9a75418dcf562b43ecc2e04ef344f00c202bf7ece6381b7eee7296d2f
6
+ metadata.gz: 9bd907eb2461f2561230b749551508e1c7cec3ae01852bd28c2528bafb4d0c1951db8a161954068e20ff00e9bc696feae8969febe62cdcc32e3dd3b600897b4f
7
+ data.tar.gz: d66e0d43c0d8a6be73535bf7015b91b1c124b0c544d5db7fb8180b6ddee00811412b9a2f24ac78c6fb578b11c7d9abd6aeeb17f66d1d6730b15913eada78a951
data/CHANGELOG.md CHANGED
@@ -1,20 +1,23 @@
1
- # 2.1.3
2
- - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
- # 2.1.2
4
- - New dependency requirements for logstash-core for the 5.0 release
1
+ ## 3.0.0
2
+ - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
3
+ ## 2.1.3
4
+ - internal,deps: Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
5
+
6
+ ## 2.1.2
7
+ - internal,deps: New dependency requirements for logstash-core for the 5.0 release
8
+
5
9
  ## 2.1.1
6
- - Fixed field references, refactors converters, code cleanups
10
+ - internal,cleanup: Fixed field references, refactors converters, code cleanups
7
11
 
8
12
  ## 2.1.0
9
- - Added support for not parsing coluns without a defined header.
10
- - Added support for dropping columns that has no value
11
- - Added support for type conversion within the filter
12
- - Fix unnecessary source field mutation. Fixes #18
13
- - Refactored specs to avoid using sample and insist in favor of rspec3
13
+ - feature: Added support for not parsing columns without a defined header.
14
+ - feature: Added support for dropping columns that has no value
15
+ - feature: Added support for type conversion within the filter
16
+ - bugfix: Fix unnecessary source field mutation. Fixes #18
17
+ - internal,test: Refactored specs to avoid using sample and insist in favor of rspec3
14
18
  helper methods.
15
19
 
16
20
  ## 2.0.0
17
- - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
21
+ - internal: Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
18
22
  instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
19
- - Dependency on logstash-core update to 2.0
20
-
23
+ - internal,deps: Dependency on logstash-core update to 2.0
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
2
+
3
+ # Specify your gem's dependencies in logstash-mass_effect.gemspec
4
+ gemspec
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-csv-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-csv-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-csv.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-csv)
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
 
@@ -101,7 +101,7 @@ class LogStash::Filters::CSV < LogStash::Filters::Base
101
101
  def filter(event)
102
102
  @logger.debug? && @logger.debug("Running csv filter", :event => event)
103
103
 
104
- if (source = event[@source])
104
+ if (source = event.get(@source))
105
105
  begin
106
106
  values = CSV.parse_line(source, :col_sep => @separator, :quote_char => @quote_char)
107
107
 
@@ -109,7 +109,7 @@ class LogStash::Filters::CSV < LogStash::Filters::Base
109
109
  unless (@skip_empty_columns && (values[i].nil? || values[i].empty?))
110
110
  unless ignore_field?(i)
111
111
  field_name = @columns[i] || "column#{i + 1}"
112
- event[field_ref(field_name)] = transform(field_name, values[i])
112
+ event.set(field_ref(field_name), transform(field_name, values[i]))
113
113
  end
114
114
  end
115
115
  end
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-csv'
4
- s.version = '2.1.3'
4
+ s.version = '3.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "The CSV filter takes an event field containing CSV data, parses it, and stores it as individual fields (can optionally specify the names)."
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"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
24
24
 
25
25
  s.add_development_dependency 'logstash-devutils'
26
26
  end
@@ -39,14 +39,14 @@ describe LogStash::Filters::CSV do
39
39
 
40
40
  it "extract all the values" do
41
41
  plugin.filter(event)
42
- expect(event["column1"]).to eq("big")
43
- expect(event["column2"]).to eq("bird")
44
- expect(event["column3"]).to eq("sesame street")
42
+ expect(event.get("column1")).to eq("big")
43
+ expect(event.get("column2")).to eq("bird")
44
+ expect(event.get("column3")).to eq("sesame street")
45
45
  end
46
46
 
47
47
  it "should not mutate the source field" do
48
48
  plugin.filter(event)
49
- expect(event["message"]).to be_kind_of(String)
49
+ expect(event.get("message")).to be_kind_of(String)
50
50
  end
51
51
  end
52
52
 
@@ -58,8 +58,8 @@ describe LogStash::Filters::CSV do
58
58
  end
59
59
  it "extract all the values" do
60
60
  plugin.filter(event)
61
- expect(event["column1"]).to eq("big,bird")
62
- expect(event["column2"]).to eq("sesame street")
61
+ expect(event.get("column1")).to eq("big,bird")
62
+ expect(event.get("column2")).to eq("sesame street")
63
63
  end
64
64
  end
65
65
 
@@ -72,9 +72,9 @@ describe LogStash::Filters::CSV do
72
72
 
73
73
  it "extract all the values" do
74
74
  plugin.filter(event)
75
- expect(event["column1"]).to eq("big")
76
- expect(event["column2"]).to eq("bird")
77
- expect(event["column3"]).to eq("sesame street")
75
+ expect(event.get("column1")).to eq("big")
76
+ expect(event.get("column2")).to eq("bird")
77
+ expect(event.get("column3")).to eq("sesame street")
78
78
  end
79
79
 
80
80
  context "using the default one" do
@@ -83,9 +83,9 @@ describe LogStash::Filters::CSV do
83
83
 
84
84
  it "extract all the values" do
85
85
  plugin.filter(event)
86
- expect(event["column1"]).to eq("big")
87
- expect(event["column2"]).to eq("bird")
88
- expect(event["column3"]).to eq("sesame, street")
86
+ expect(event.get("column1")).to eq("big")
87
+ expect(event.get("column2")).to eq("bird")
88
+ expect(event.get("column3")).to eq("sesame, street")
89
89
  end
90
90
  end
91
91
 
@@ -97,9 +97,9 @@ describe LogStash::Filters::CSV do
97
97
 
98
98
  it "extract all the values" do
99
99
  plugin.filter(event)
100
- expect(event["column1"]).to eq("big")
101
- expect(event["column2"]).to eq("bird")
102
- expect(event["column3"]).to eq('"sesame" street')
100
+ expect(event.get("column1")).to eq("big")
101
+ expect(event.get("column2")).to eq("bird")
102
+ expect(event.get("column3")).to eq('"sesame" street')
103
103
  end
104
104
  end
105
105
  end
@@ -112,9 +112,9 @@ describe LogStash::Filters::CSV do
112
112
 
113
113
  it "extract all the values" do
114
114
  plugin.filter(event)
115
- expect(event["first"]).to eq("big")
116
- expect(event["last"]).to eq("bird")
117
- expect(event["address"]).to eq("sesame street")
115
+ expect(event.get("first")).to eq("big")
116
+ expect(event.get("last")).to eq("bird")
117
+ expect(event.get("address")).to eq("sesame street")
118
118
  end
119
119
 
120
120
  context "parse csv without autogeneration of names" do
@@ -127,9 +127,9 @@ describe LogStash::Filters::CSV do
127
127
 
128
128
  it "extract all the values" do
129
129
  plugin.filter(event)
130
- expect(event["custom1"]).to eq("val1")
131
- expect(event["custom2"]).to eq("val2")
132
- expect(event["column3"]).to be_falsey
130
+ expect(event.get("custom1")).to eq("val1")
131
+ expect(event.get("custom2")).to eq("val2")
132
+ expect(event.get("column3")).to be_falsey
133
133
  end
134
134
  end
135
135
 
@@ -147,9 +147,9 @@ describe LogStash::Filters::CSV do
147
147
 
148
148
  it "extract all the values" do
149
149
  plugin.filter(event)
150
- expect(event["custom1"]).to eq("val1")
151
- expect(event["custom2"]).to be_falsey
152
- expect(event["custom3"]).to eq("val3")
150
+ expect(event.get("custom1")).to eq("val1")
151
+ expect(event.get("custom2")).to be_falsey
152
+ expect(event.get("custom3")).to eq("val3")
153
153
  end
154
154
  end
155
155
 
@@ -161,9 +161,9 @@ describe LogStash::Filters::CSV do
161
161
 
162
162
  it "extract all the values" do
163
163
  plugin.filter(event)
164
- expect(event["custom1"]).to eq("val1")
165
- expect(event["custom2"]).to eq("val2")
166
- expect(event["column3"]).to eq("val3")
164
+ expect(event.get("custom1")).to eq("val1")
165
+ expect(event.get("custom2")).to eq("val2")
166
+ expect(event.get("column3")).to eq("val3")
167
167
  end
168
168
  end
169
169
 
@@ -177,9 +177,9 @@ describe LogStash::Filters::CSV do
177
177
 
178
178
  it "extract all the values" do
179
179
  plugin.filter(event)
180
- expect(event["custom1"]).to eq("val1")
181
- expect(event["custom2"]).to eq("val2")
182
- expect(event["custom3"]).to eq("val3")
180
+ expect(event.get("custom1")).to eq("val1")
181
+ expect(event.get("custom2")).to eq("val2")
182
+ expect(event.get("custom3")).to eq("val3")
183
183
  end
184
184
  end
185
185
  end
@@ -193,9 +193,9 @@ describe LogStash::Filters::CSV do
193
193
 
194
194
  it "extract all the values" do
195
195
  plugin.filter(event)
196
- expect(event["data"]["column1"]).to eq("big")
197
- expect(event["data"]["column2"]).to eq("bird")
198
- expect(event["data"]["column3"]).to eq("sesame street")
196
+ expect(event.get("data")["column1"]).to eq("big")
197
+ expect(event.get("data")["column2"]).to eq("bird")
198
+ expect(event.get("data")["column3"]).to eq("sesame street")
199
199
  end
200
200
 
201
201
  context "when having also source" do
@@ -208,9 +208,9 @@ describe LogStash::Filters::CSV do
208
208
 
209
209
  it "extract all the values" do
210
210
  plugin.filter(event)
211
- expect(event["data"]["column1"]).to eq("big")
212
- expect(event["data"]["column2"]).to eq("bird")
213
- expect(event["data"]["column3"]).to eq("sesame street")
211
+ expect(event.get("data")["column1"]).to eq("big")
212
+ expect(event.get("data")["column2"]).to eq("bird")
213
+ expect(event.get("data")["column3"]).to eq("sesame street")
214
214
  end
215
215
  end
216
216
  end
@@ -225,9 +225,9 @@ describe LogStash::Filters::CSV do
225
225
 
226
226
  it "get converted values to the expected type" do
227
227
  plugin.filter(event)
228
- expect(event["column1"]).to eq(1234)
229
- expect(event["column2"]).to eq("bird")
230
- expect(event["column3"]).to eq(false)
228
+ expect(event.get("column1")).to eq(1234)
229
+ expect(event.get("column2")).to eq("bird")
230
+ expect(event.get("column3")).to eq(false)
231
231
  end
232
232
 
233
233
  context "when using column names" do
@@ -239,9 +239,9 @@ describe LogStash::Filters::CSV do
239
239
 
240
240
  it "get converted values to the expected type" do
241
241
  plugin.filter(event)
242
- expect(event["custom1"]).to eq(1234)
243
- expect(event["custom2"]).to eq("bird")
244
- expect(event["custom3"]).to eq(false)
242
+ expect(event.get("custom1")).to eq(1234)
243
+ expect(event.get("custom2")).to eq("bird")
244
+ expect(event.get("custom3")).to eq(false)
245
245
  end
246
246
  end
247
247
  end
metadata CHANGED
@@ -1,44 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
- version: '1.0'
19
- name: logstash-core-plugin-api
20
- prerelease: false
19
+ version: '2.0'
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: logstash-devutils
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
- name: logstash-devutils
34
- prerelease: false
35
34
  type: :development
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- 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
41
+ description: This gem is a Logstash plugin required to be installed on top of the
42
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
43
+ gem is not a stand-alone program
42
44
  email: info@elastic.co
43
45
  executables: []
44
46
  extensions: []
@@ -59,7 +61,7 @@ licenses:
59
61
  metadata:
60
62
  logstash_plugin: 'true'
61
63
  logstash_group: filter
62
- post_install_message:
64
+ post_install_message:
63
65
  rdoc_options: []
64
66
  require_paths:
65
67
  - lib
@@ -74,10 +76,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
76
  - !ruby/object:Gem::Version
75
77
  version: '0'
76
78
  requirements: []
77
- rubyforge_project:
78
- rubygems_version: 2.4.8
79
- signing_key:
79
+ rubyforge_project:
80
+ rubygems_version: 2.5.1
81
+ signing_key:
80
82
  specification_version: 4
81
- summary: The CSV filter takes an event field containing CSV data, parses it, and stores it as individual fields (can optionally specify the names).
83
+ summary: The CSV filter takes an event field containing CSV data, parses it, and stores
84
+ it as individual fields (can optionally specify the names).
82
85
  test_files:
83
86
  - spec/filters/csv_spec.rb