mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
rename PUNCT to PUNCTUATION
This commit is contained in:
parent
6d1ffc3583
commit
5f698a21c9
2 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,7 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
|
|||
config :key, :validate => :string
|
||||
|
||||
# Fingerprint method
|
||||
config :method, :validate => ['SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5', "MURMUR3", "IPV4_NETWORK", "UUID", "PUNCT"], :required => true, :default => 'SHA1'
|
||||
config :method, :validate => ['SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5', "MURMUR3", "IPV4_NETWORK", "UUID", "PUNCTUATION"], :required => true, :default => 'SHA1'
|
||||
|
||||
# When set to true, we concatenate the values of all fields into 1 string like the old checksum filter.
|
||||
config :concatenate_sources, :validate => :boolean, :default => false
|
||||
|
@ -37,7 +37,7 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
|
|||
class << self; alias_method :anonymize, :anonymize_murmur3; end
|
||||
when "UUID"
|
||||
require "securerandom"
|
||||
when "PUNCT"
|
||||
when "PUNCTUATION"
|
||||
# nothing required
|
||||
else
|
||||
require 'openssl'
|
||||
|
@ -52,7 +52,7 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
|
|||
case @method
|
||||
when "UUID"
|
||||
event[@target] = SecureRandom.uuid
|
||||
when "PUNCT"
|
||||
when "PUNCTUATION"
|
||||
@source.sort.each do |field|
|
||||
next unless event.include?(field)
|
||||
event[@target] = event[field].tr('A-Za-z0-9 \t','')
|
||||
|
|
|
@ -147,12 +147,12 @@ describe LogStash::Filters::Fingerprint do
|
|||
end
|
||||
end
|
||||
|
||||
describe "PUNCT method" do
|
||||
describe "PUNCTUATION method" do
|
||||
config <<-CONFIG
|
||||
filter {
|
||||
fingerprint {
|
||||
source => 'field1'
|
||||
method => 'PUNCT'
|
||||
method => 'PUNCTUATION'
|
||||
}
|
||||
}
|
||||
CONFIG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue