logstash-filter-kv 4.1.0 → 4.1.1
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/kv.rb +1 -1
- data/logstash-filter-kv.gemspec +1 -1
- data/spec/filters/kv_spec.rb +33 -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: 5c2b2e468b13494eda3ab5a4252ec1bc3b1ac73516c7de0f767d5f3a21d1c467
|
4
|
+
data.tar.gz: 145252f085544e2edbceef88a6bef4cc720f6ce745e022150c25657588c3f6d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 718f14bae4895dd2d9cfc252abaace7ae1f784703ec569fb9143946d21378d638889dca25db6f430bdaa25f7838eedda6c2e08eab76d520385701b7171752bcb
|
7
|
+
data.tar.gz: acee9e93136b19746cac5714cf46d5d45e0780caba1ab935aa42a1f26baaa45a111b5214b04cb7dff6499e11a2f6011053d7a46180f8c9b6d78419d80f5b2e13
|
data/CHANGELOG.md
CHANGED
data/lib/logstash/filters/kv.rb
CHANGED
@@ -356,7 +356,7 @@ class LogStash::Filters::KV < LogStash::Filters::Base
|
|
356
356
|
end
|
357
357
|
|
358
358
|
# an unquoted value is a _captured_ sequence of characters or escaped spaces before a `field_split` or EOF.
|
359
|
-
value_patterns << /((?:\\ |.)
|
359
|
+
value_patterns << /((?:\\ |.)*?)(?=#{Regexp::union(field_split, eof)})/
|
360
360
|
|
361
361
|
Regexp.union(*value_patterns)
|
362
362
|
end
|
data/logstash-filter-kv.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-kv'
|
4
|
-
s.version = '4.1.
|
4
|
+
s.version = '4.1.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Parses key-value pairs"
|
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/kv_spec.rb
CHANGED
@@ -897,4 +897,37 @@ describe "multi character splitting" do
|
|
897
897
|
end
|
898
898
|
end
|
899
899
|
|
900
|
+
describe "handles empty values" do
|
901
|
+
let(:message) { 'a=1|b=|c=3' }
|
902
|
+
|
903
|
+
shared_examples "parse empty values" do
|
904
|
+
it "splits correctly upon empty value" do
|
905
|
+
subject.filter(event)
|
906
|
+
|
907
|
+
expect(event.get("a")).to eq("1")
|
908
|
+
expect(event.get("b")).to be_nil
|
909
|
+
expect(event.get("c")).to eq("3")
|
910
|
+
end
|
911
|
+
end
|
912
|
+
|
913
|
+
context "using char class splitters" do
|
914
|
+
let(:options) {
|
915
|
+
{
|
916
|
+
"field_split" => "|",
|
917
|
+
"value_split" => "=",
|
918
|
+
}
|
919
|
+
}
|
920
|
+
it_behaves_like "parse empty values"
|
921
|
+
end
|
922
|
+
|
923
|
+
context "using pattern splitters" do
|
924
|
+
let(:options) {
|
925
|
+
{
|
926
|
+
"field_split_pattern" => '\|',
|
927
|
+
"value_split_pattern" => "=",
|
928
|
+
}
|
929
|
+
}
|
930
|
+
it_behaves_like "parse empty values"
|
931
|
+
end
|
932
|
+
end
|
900
933
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-kv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
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
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|