logstash-filter-csv 3.0.1 → 3.0.2
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/csv.rb +7 -0
- data/logstash-filter-csv.gemspec +2 -2
- data/spec/filters/csv_spec.rb +14 -0
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e2d4379b16ea4358cfffca7c0922024af7f2e80
|
4
|
+
data.tar.gz: fc2a74ee00ef3598a94765f142d0d21bea669f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56696d58d95c9703886e6ac1c8fd4e70851550d4cd8f3f38effacea4bd7f4360aee0544a05ae8348dc8ca59bd97ac8835ee9d18c34ab4e13c59ce833b5a5f496
|
7
|
+
data.tar.gz: b02418749ef7a9b5bd7dc9d1b5a4bbd10b39e266344c7ceb1983801757474e07fc70887a15b42a1a7699e455fcf0ecba473c72f60960565c81692153faa2b6c0
|
data/CHANGELOG.md
CHANGED
data/lib/logstash/filters/csv.rb
CHANGED
@@ -96,6 +96,13 @@ class LogStash::Filters::CSV < LogStash::Filters::Base
|
|
96
96
|
|
97
97
|
# make sure @target is in the format [field name] if defined, i.e. surrounded by brakets
|
98
98
|
@target = "[#{@target}]" if @target && @target !~ /^\[[^\[\]]+\]$/
|
99
|
+
|
100
|
+
# if the zero byte character is entered in the config, set the value
|
101
|
+
if (@quote_char == "\\x00")
|
102
|
+
@quote_char = "\x00"
|
103
|
+
end
|
104
|
+
|
105
|
+
@logger.debug? && @logger.debug("CSV parsing options", :col_sep => @separator, :quote_char => @quote_char)
|
99
106
|
end
|
100
107
|
|
101
108
|
def filter(event)
|
data/logstash-filter-csv.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-csv'
|
4
|
-
s.version = '3.0.
|
4
|
+
s.version = '3.0.2'
|
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
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"
|
@@ -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", "
|
23
|
+
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
24
24
|
|
25
25
|
s.add_development_dependency 'logstash-devutils'
|
26
26
|
end
|
data/spec/filters/csv_spec.rb
CHANGED
@@ -102,6 +102,20 @@ describe LogStash::Filters::CSV do
|
|
102
102
|
expect(event.get("column3")).to eq('"sesame" street')
|
103
103
|
end
|
104
104
|
end
|
105
|
+
|
106
|
+
context "using a null as read from config" do
|
107
|
+
let(:doc) { 'big,bird,"sesame" street' }
|
108
|
+
let(:config) do
|
109
|
+
{ "quote_char" => "\\x00" }
|
110
|
+
end
|
111
|
+
|
112
|
+
it "extract all the values" do
|
113
|
+
plugin.filter(event)
|
114
|
+
expect(event.get("column1")).to eq("big")
|
115
|
+
expect(event.get("column2")).to eq("bird")
|
116
|
+
expect(event.get("column3")).to eq('"sesame" street')
|
117
|
+
end
|
118
|
+
end
|
105
119
|
end
|
106
120
|
|
107
121
|
describe "given column names" do
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- - "
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.60'
|
19
|
+
- - "<="
|
17
20
|
- !ruby/object:Gem::Version
|
18
|
-
version: '2.
|
21
|
+
version: '2.99'
|
19
22
|
name: logstash-core-plugin-api
|
20
23
|
prerelease: false
|
21
24
|
type: :runtime
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.60'
|
30
|
+
- - "<="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
32
|
+
version: '2.99'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
29
35
|
requirements:
|
@@ -75,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
81
|
version: '0'
|
76
82
|
requirements: []
|
77
83
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.6.3
|
79
85
|
signing_key:
|
80
86
|
specification_version: 4
|
81
87
|
summary: The CSV filter takes an event field containing CSV data, parses it, and stores it as individual fields (can optionally specify the names).
|