logstash-filter-fingerprint 3.2.0 → 3.2.1
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/filters/fingerprint.rb +12 -5
- data/logstash-filter-fingerprint.gemspec +1 -1
- 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: 3a80216d6dfbd2b4724fe593ce35e2c57ea7501f3c9fb78efbed7122c953b875
|
4
|
+
data.tar.gz: 3ad6b211481f4b7eb7233055e2665b13d5329a2c41af220b77bad02566581e0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4315fa59ed1276927c5af00e033652eed383e375956a632ddd572866d8e702daef3406040ccbd649f15885bd74e1ad68be70e93b812d1af9a0a9b15d3198d18d
|
7
|
+
data.tar.gz: e9137e8dd254c15b6a27ed4eddd2dd785c09410e84978148adf424449aefeadfc6f7af48dd2431c1032bab4d3dc0500d2ecfd4411f00009d578f529c020b6c26
|
data/CHANGELOG.md
CHANGED
@@ -100,7 +100,6 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
|
|
100
100
|
# nothing
|
101
101
|
else
|
102
102
|
class << self; alias_method :fingerprint, :fingerprint_openssl; end
|
103
|
-
@digest = select_digest(@method)
|
104
103
|
end
|
105
104
|
end
|
106
105
|
|
@@ -153,19 +152,27 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
|
|
153
152
|
end
|
154
153
|
|
155
154
|
def fingerprint_openssl(data)
|
155
|
+
# since OpenSSL::Digest instances aren't thread safe, we must ensure that
|
156
|
+
# each pipeline worker thread gets its own instance.
|
157
|
+
# Also, since a logstash pipeline may contain multiple fingerprint filters
|
158
|
+
# we must include the id in the thread local variable name, so that we can
|
159
|
+
# store multiple digest instances
|
160
|
+
digest_string = "digest-#{id}"
|
161
|
+
Thread.current[digest_string] ||= select_digest(@method)
|
162
|
+
digest = Thread.current[digest_string]
|
156
163
|
# in JRuby 1.7.11 outputs as ASCII-8BIT
|
157
164
|
if @key.nil?
|
158
165
|
if @base64encode
|
159
|
-
|
166
|
+
digest.base64digest(data.to_s).force_encoding(Encoding::UTF_8)
|
160
167
|
else
|
161
|
-
|
168
|
+
digest.hexdigest(data.to_s).force_encoding(Encoding::UTF_8)
|
162
169
|
end
|
163
170
|
else
|
164
171
|
if @base64encode
|
165
|
-
hash = OpenSSL::HMAC.digest(
|
172
|
+
hash = OpenSSL::HMAC.digest(digest, @key, data.to_s)
|
166
173
|
Base64.strict_encode64(hash).force_encoding(Encoding::UTF_8)
|
167
174
|
else
|
168
|
-
OpenSSL::HMAC.hexdigest(
|
175
|
+
OpenSSL::HMAC.hexdigest(digest, @key, data.to_s).force_encoding(Encoding::UTF_8)
|
169
176
|
end
|
170
177
|
end
|
171
178
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-fingerprint'
|
4
|
-
s.version = '3.2.
|
4
|
+
s.version = '3.2.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"
|
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.2.
|
4
|
+
version: 3.2.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-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|