logstash-filter-fingerprint 3.3.0 → 3.3.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/fingerprint.rb +4 -2
- data/logstash-filter-fingerprint.gemspec +1 -1
- data/spec/filters/fingerprint_spec.rb +17 -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: 595333133cc076fc879955fa5a665387dfd4d33d4af757d56d163a6a3eeb16d8
|
4
|
+
data.tar.gz: 912e104bd727b7b3f427d24f038288ca5d08087242267d55b4fc6899403ba378
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9f4631d499c888a5681c63be1d254d45392fc00c6e281d6bb5ddcd24028d0af43e4e0c6b9f99a0a082693e5559a44fb4d2ce5a3894e2c5081d9937e94ccb15e
|
7
|
+
data.tar.gz: c280e2fc1b976d11e9e57ccb444f8153e953f9f0ff7f74b393e1b1c670d9ed4c6932d8af14a6883806f0079419292df8aae9130fb1334ff4013e193a0c989925
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 3.3.1
|
2
|
+
- Force encoding to UTF-8 when concatenating sources to generate fingerprint [#64](https://github.com/logstash-plugins/logstash-filter-fingerprint/pull/64)
|
3
|
+
|
1
4
|
## 3.3.0
|
2
5
|
- Add ECS compatibility [#62](https://github.com/logstash-plugins/logstash-filter-fingerprint/pull/62)
|
3
6
|
|
@@ -128,11 +128,13 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
|
|
128
128
|
to_string = ""
|
129
129
|
if @concatenate_all_fields
|
130
130
|
deep_sort_hashes(event.to_hash).each do |k,v|
|
131
|
-
|
131
|
+
# Force encoding to UTF-8 to get around https://github.com/jruby/jruby/issues/6748
|
132
|
+
to_string << "|#{k}|#{v}".force_encoding("UTF-8")
|
132
133
|
end
|
133
134
|
else
|
134
135
|
@source.sort.each do |k|
|
135
|
-
|
136
|
+
# Force encoding to UTF-8 to get around https://github.com/jruby/jruby/issues/6748
|
137
|
+
to_string << "|#{k}|#{deep_sort_hashes(event.get(k))}".force_encoding("UTF-8")
|
136
138
|
end
|
137
139
|
end
|
138
140
|
to_string << "|"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-fingerprint'
|
4
|
-
s.version = '3.3.
|
4
|
+
s.version = '3.3.1'
|
5
5
|
s.licenses = ['Apache-2.0']
|
6
6
|
s.summary = "Fingerprints fields by replacing values with a consistent hash"
|
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"
|
@@ -192,6 +192,23 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
+
context "when utf-8 chars used" do
|
196
|
+
let(:config) { super().merge("source" => ['field1', 'field2']) }
|
197
|
+
let(:data) { {"field1"=>[{"inner_key"=>"🂡"}, {"1"=>"2"}], "field2"=>"🂡"} }
|
198
|
+
it "fingerprints the value of the last value" do
|
199
|
+
# SHA1 of "|field1|inner_key|🂡|1|2|field2|🂡|"
|
200
|
+
expect(fingerprint).to eq("58fa9e0e60c9f0d24b51d84cddb26732a39eeb3d")
|
201
|
+
end
|
202
|
+
|
203
|
+
describe "with concatenate_sources" do
|
204
|
+
let(:config) { super().merge("concatenate_sources" => true) }
|
205
|
+
it "fingerprints the value of concatenated key/pairs" do
|
206
|
+
# SHA1 of "|field1|inner_key|🂡|1|2|field2|🂡|"
|
207
|
+
expect(fingerprint).to eq("d74f41841c7cdc793a97c218d2ff18064a5f1950")
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
195
212
|
describe "PUNCTUATION method" do
|
196
213
|
let(:fingerprint_method) { 'PUNCTUATION' }
|
197
214
|
let(:config) { super().merge("source" => 'field1') }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-fingerprint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|