logstash-filter-fingerprint 2.0.5 → 3.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c40923e054f8beba54533d9ac786b5d8c24c7c44
4
- data.tar.gz: a49ced8c1813cfddaa270a63a1541151e1ecbd09
3
+ metadata.gz: 85ddc37bca74c6475be262f4243f3577476c0c5f
4
+ data.tar.gz: cff2ab142df9a4db29f0fb1ec9a82bd0638840c4
5
5
  SHA512:
6
- metadata.gz: 5c57fabaed19f8d73a5da75e740850a37167a49636d6d26015a53e85aa04dcdf38557abdc0fa74b70aba5db3c1db8611b3df3f884151d85ae4da17b54598439a
7
- data.tar.gz: 1444c01c21c0ec6a2afa4c608ffc6402fa39d6992bb79f30f881cecea42986b86bfd72670e0c82adb9ebf503e09e52be84de1e2095e1c6208892560720a86381
6
+ metadata.gz: 9508e12ca0baecc428f34abc244f432c35c55e159587ec012a2976114f67ed2b2827fcbb85b0ecba9af3b09cde139519692885775892943b639dac1b87b82022
7
+ data.tar.gz: 494f9e17a0a6124f90927d35caa779d0d6243e2a600b21c7c8e15a922d39126b8ebf7e9cb66fa84fb01514fd4ada10bc28014dfd647461b01da23aa280bfc452
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
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
1
3
  # 2.0.5
2
4
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
5
  # 2.0.4
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-fingerprint-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-fingerprint-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-fingerprint.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-fingerprint)
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
 
@@ -72,31 +72,31 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
72
72
  def filter(event)
73
73
  case @method
74
74
  when :UUID
75
- event[@target] = SecureRandom.uuid
75
+ event.set(@target, SecureRandom.uuid)
76
76
  when :PUNCTUATION
77
77
  @source.sort.each do |field|
78
78
  next unless event.include?(field)
79
79
  # In order to keep some backwards compatibility we should use the unicode version
80
80
  # of the regexp because the POSIX one ([[:punct:]]) left some unwanted characters unfiltered (Symbols).
81
81
  # gsub(/[^[:punct:]]/,'') should be equivalent to gsub(/[^[\p{P}\p{S}]]/,''), but not 100% in JRuby.
82
- event[@target] = event[field].gsub(/[^[\p{P}\p{S}]]/,'')
82
+ event.set(@target, event.get(field).gsub(/[^[\p{P}\p{S}]]/,''))
83
83
  end
84
84
  else
85
85
  if @concatenate_sources
86
86
  to_string = ""
87
87
  @source.sort.each do |k|
88
- to_string << "|#{k}|#{event[k]}"
88
+ to_string << "|#{k}|#{event.get(k)}"
89
89
  end
90
90
  to_string << "|"
91
91
  @logger.debug? && @logger.debug("String built", :to_checksum => to_string)
92
- event[@target] = anonymize(to_string)
92
+ event.set(@target, anonymize(to_string))
93
93
  else
94
94
  @source.each do |field|
95
95
  next unless event.include?(field)
96
- if event[field].is_a?(Array)
97
- event[@target] = event[field].collect { |v| anonymize(v) }
96
+ if event.get(field).is_a?(Array)
97
+ event.set(@target, event.get(field).collect { |v| anonymize(v) })
98
98
  else
99
- event[@target] = anonymize(event[field])
99
+ event.set(@target, anonymize(event.get(field)))
100
100
  end
101
101
  end
102
102
  end
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-fingerprint'
4
- s.version = '2.0.5'
4
+ s.version = '3.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Fingerprint fields using by replacing values with a consistent hash."
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
  s.add_runtime_dependency "murmurhash3" #(MIT license)
25
25
  s.add_development_dependency 'logstash-devutils'
26
26
  end
@@ -16,7 +16,7 @@ describe LogStash::Filters::Fingerprint do
16
16
  CONFIG
17
17
 
18
18
  sample("clientip" => "233.255.13.44") do
19
- insist { subject["fingerprint"] } == "233.255.13.0"
19
+ insist { subject.get("fingerprint") } == "233.255.13.0"
20
20
  end
21
21
  end
22
22
 
@@ -31,7 +31,7 @@ describe LogStash::Filters::Fingerprint do
31
31
  CONFIG
32
32
 
33
33
  sample("clientip" => "123.52.122.33") do
34
- insist { subject["fingerprint"] } == 1541804874
34
+ insist { subject.get("fingerprint") } == 1541804874
35
35
  end
36
36
  end
37
37
 
@@ -47,7 +47,7 @@ describe LogStash::Filters::Fingerprint do
47
47
  CONFIG
48
48
 
49
49
  sample("clientip" => "123.123.123.123") do
50
- insist { subject["fingerprint"] } == "fdc60acc4773dc5ac569ffb78fcb93c9630797f4"
50
+ insist { subject.get("fingerprint") } == "fdc60acc4773dc5ac569ffb78fcb93c9630797f4"
51
51
  end
52
52
  end
53
53
 
@@ -64,7 +64,7 @@ describe LogStash::Filters::Fingerprint do
64
64
  CONFIG
65
65
 
66
66
  sample("clientip" => "123.123.123.123") do
67
- insist { subject["fingerprint"] } == "/cYKzEdz3FrFaf+3j8uTyWMHl/Q="
67
+ insist { subject.get("fingerprint") } == "/cYKzEdz3FrFaf+3j8uTyWMHl/Q="
68
68
  end
69
69
  end
70
70
 
@@ -80,7 +80,7 @@ describe LogStash::Filters::Fingerprint do
80
80
  CONFIG
81
81
 
82
82
  sample("clientip" => "123.123.123.123") do
83
- insist { subject["fingerprint"] } == "345bec3eff242d53b568916c2610b3e393d885d6b96d643f38494fd74bf4a9ca"
83
+ insist { subject.get("fingerprint") } == "345bec3eff242d53b568916c2610b3e393d885d6b96d643f38494fd74bf4a9ca"
84
84
  end
85
85
  end
86
86
 
@@ -97,7 +97,7 @@ describe LogStash::Filters::Fingerprint do
97
97
  CONFIG
98
98
 
99
99
  sample("clientip" => "123.123.123.123") do
100
- insist { subject["fingerprint"] } == "NFvsPv8kLVO1aJFsJhCz45PYhda5bWQ/OElP10v0qco="
100
+ insist { subject.get("fingerprint") } == "NFvsPv8kLVO1aJFsJhCz45PYhda5bWQ/OElP10v0qco="
101
101
  end
102
102
  end
103
103
 
@@ -113,7 +113,7 @@ describe LogStash::Filters::Fingerprint do
113
113
  CONFIG
114
114
 
115
115
  sample("clientip" => "123.123.123.123") do
116
- insist { subject["fingerprint"] } == "22d4c0e8c4fbcdc4887d2038fca7650f0e2e0e2457ff41c06eb2a980dded6749561c814fe182aff93e2538d18593947a"
116
+ insist { subject.get("fingerprint") } == "22d4c0e8c4fbcdc4887d2038fca7650f0e2e0e2457ff41c06eb2a980dded6749561c814fe182aff93e2538d18593947a"
117
117
  end
118
118
  end
119
119
 
@@ -130,7 +130,7 @@ describe LogStash::Filters::Fingerprint do
130
130
  CONFIG
131
131
 
132
132
  sample("clientip" => "123.123.123.123") do
133
- insist { subject["fingerprint"] } == "ItTA6MT7zcSIfSA4/KdlDw4uDiRX/0HAbrKpgN3tZ0lWHIFP4YKv+T4lONGFk5R6"
133
+ insist { subject.get("fingerprint") } == "ItTA6MT7zcSIfSA4/KdlDw4uDiRX/0HAbrKpgN3tZ0lWHIFP4YKv+T4lONGFk5R6"
134
134
  end
135
135
  end
136
136
 
@@ -146,7 +146,7 @@ describe LogStash::Filters::Fingerprint do
146
146
  CONFIG
147
147
 
148
148
  sample("clientip" => "123.123.123.123") do
149
- insist { subject["fingerprint"] } == "11c19b326936c08d6c50a3c847d883e5a1362e6a64dd55201a25f2c1ac1b673f7d8bf15b8f112a4978276d573275e3b14166e17246f670c2a539401c5bfdace8"
149
+ insist { subject.get("fingerprint") } == "11c19b326936c08d6c50a3c847d883e5a1362e6a64dd55201a25f2c1ac1b673f7d8bf15b8f112a4978276d573275e3b14166e17246f670c2a539401c5bfdace8"
150
150
  end
151
151
  end
152
152
 
@@ -163,7 +163,7 @@ describe LogStash::Filters::Fingerprint do
163
163
  CONFIG
164
164
 
165
165
  sample("clientip" => "123.123.123.123") do
166
- insist { subject["fingerprint"] } == "EcGbMmk2wI1sUKPIR9iD5aE2Lmpk3VUgGiXywawbZz99i/FbjxEqSXgnbVcydeOxQWbhckb2cMKlOUAcW/2s6A=="
166
+ insist { subject.get("fingerprint") } == "EcGbMmk2wI1sUKPIR9iD5aE2Lmpk3VUgGiXywawbZz99i/FbjxEqSXgnbVcydeOxQWbhckb2cMKlOUAcW/2s6A=="
167
167
  end
168
168
  end
169
169
 
@@ -179,7 +179,7 @@ describe LogStash::Filters::Fingerprint do
179
179
  CONFIG
180
180
 
181
181
  sample("clientip" => "123.123.123.123") do
182
- insist { subject["fingerprint"] } == "9336c879e305c9604a3843fc3e75948f"
182
+ insist { subject.get("fingerprint") } == "9336c879e305c9604a3843fc3e75948f"
183
183
  end
184
184
  end
185
185
 
@@ -196,7 +196,7 @@ describe LogStash::Filters::Fingerprint do
196
196
  CONFIG
197
197
 
198
198
  sample("clientip" => "123.123.123.123") do
199
- insist { subject["fingerprint"] } == "kzbIeeMFyWBKOEP8PnWUjw=="
199
+ insist { subject.get("fingerprint") } == "kzbIeeMFyWBKOEP8PnWUjw=="
200
200
  end
201
201
  end
202
202
 
@@ -212,7 +212,7 @@ describe LogStash::Filters::Fingerprint do
212
212
  CONFIG
213
213
 
214
214
  sample("clientip" => [ "123.123.123.123", "223.223.223.223" ]) do
215
- insist { subject["fingerprint"]} == [ "9336c879e305c9604a3843fc3e75948f", "7a6c66b8d3f42a7d650e3354af508df3" ]
215
+ insist { subject.get("fingerprint")} == [ "9336c879e305c9604a3843fc3e75948f", "7a6c66b8d3f42a7d650e3354af508df3" ]
216
216
  end
217
217
  end
218
218
 
@@ -228,7 +228,7 @@ describe LogStash::Filters::Fingerprint do
228
228
  CONFIG
229
229
 
230
230
  sample("field1" => "test1", "field2" => "test2") do
231
- insist { subject["fingerprint"]} == "872da745e45192c2a1d4bf7c1ff8a370"
231
+ insist { subject.get("fingerprint")} == "872da745e45192c2a1d4bf7c1ff8a370"
232
232
  end
233
233
  end
234
234
 
@@ -243,11 +243,11 @@ describe LogStash::Filters::Fingerprint do
243
243
  CONFIG
244
244
 
245
245
  sample("field1" => "PHP Warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in /var/www/htdocs/test.php on line 233") do
246
- insist { subject["fingerprint"] } == ":_()[<='.-'>.-</>]:-////."
246
+ insist { subject.get("fingerprint") } == ":_()[<='.-'>.-</>]:-////."
247
247
  end
248
248
 
249
249
  sample("field1" => "Warning: Ruby(ルビ) is an awesome language.") do
250
- insist { subject["fingerprint"] } == ":()."
250
+ insist { subject.get("fingerprint") } == ":()."
251
251
  end
252
252
  end
253
253
 
@@ -266,7 +266,7 @@ describe LogStash::Filters::Fingerprint do
266
266
  CONFIG
267
267
 
268
268
  sample("@timestamp" => epoch_time) do
269
- insist { subject["fingerprint"] } == '1d5379ec92d86a67cfc642d55aa050ca312d3b9a'
269
+ insist { subject.get("fingerprint") } == '1d5379ec92d86a67cfc642d55aa050ca312d3b9a'
270
270
  end
271
271
  end
272
272
 
@@ -281,7 +281,7 @@ describe LogStash::Filters::Fingerprint do
281
281
  CONFIG
282
282
 
283
283
  sample("@timestamp" => epoch_time) do
284
- insist { subject["fingerprint"] } == 743372282
284
+ insist { subject.get("fingerprint") } == 743372282
285
285
  end
286
286
  end
287
287
  end
metadata CHANGED
@@ -1,58 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-fingerprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
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: murmurhash3
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
- name: murmurhash3
34
- prerelease: false
35
34
  type: :runtime
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
41
  - !ruby/object:Gem::Dependency
42
+ name: logstash-devutils
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
- name: logstash-devutils
48
- prerelease: false
49
48
  type: :development
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- 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
55
+ description: This gem is a Logstash plugin required to be installed on top of the
56
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
57
+ gem is not a stand-alone program
56
58
  email: info@elastic.co
57
59
  executables: []
58
60
  extensions: []
@@ -73,7 +75,7 @@ licenses:
73
75
  metadata:
74
76
  logstash_plugin: 'true'
75
77
  logstash_group: filter
76
- post_install_message:
78
+ post_install_message:
77
79
  rdoc_options: []
78
80
  require_paths:
79
81
  - lib
@@ -88,9 +90,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
90
  - !ruby/object:Gem::Version
89
91
  version: '0'
90
92
  requirements: []
91
- rubyforge_project:
92
- rubygems_version: 2.4.8
93
- signing_key:
93
+ rubyforge_project:
94
+ rubygems_version: 2.5.1
95
+ signing_key:
94
96
  specification_version: 4
95
97
  summary: Fingerprint fields using by replacing values with a consistent hash.
96
98
  test_files: