- JRuby doesn't implemtn HMAC-SHA ?

1) LogStash::Filters::Anonymize anonymize string with SHA alogrithm ...
       Failure/Error: filter.filter(e)
       NotImplementedError:
         Algorithm HMAC-SHA not available
       # ./lib/logstash/filters/anonymize.rb:51:in `anonymize_openssl'

Disable it.
This commit is contained in:
Jordan Sissel 2012-12-31 14:06:02 -08:00
parent 8eeabcd43d
commit 62fea57657
2 changed files with 3 additions and 21 deletions

View file

@ -15,7 +15,7 @@ class LogStash::Filters::Anonymize < LogStash::Filters::Base
config :key, :validate => :string, :required => true
# digest/hash type
config :algorithm, :validate => ['SHA', 'SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512', 'MD4', 'MD5', "MURMUR3", "IPV4_NETWORK"], :required => true, :default => 'SHA1'
config :algorithm, :validate => ['SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512', 'MD4', 'MD5', "MURMUR3", "IPV4_NETWORK"], :required => true, :default => 'SHA1'
public
def register
@ -63,8 +63,8 @@ class LogStash::Filters::Anonymize < LogStash::Filters::Base
def algorithm
case @algorithm
when 'SHA'
return OpenSSL::Digest::SHA.new
#when 'SHA'
#return OpenSSL::Digest::SHA.new
when 'SHA1'
return OpenSSL::Digest::SHA1.new
when 'SHA224'

View file

@ -4,24 +4,6 @@ require "logstash/filters/anonymize"
describe LogStash::Filters::Anonymize do
extend LogStash::RSpec
describe "anonymize string with SHA alogrithm" do
# The logstash config goes here.
# At this time, only filters are supported.
config <<-CONFIG
filter {
anonymize {
fields => ["clientip"]
key => "longencryptionkey"
algorithm => 'SHA'
}
}
CONFIG
sample "@fields" => {"clientip" => "123.123.123.123"} do
insist { subject["clientip"] } == "0d01b2191194d261fa1a2e7c18a38d44953ab4e2"
end
end
describe "anonymize ipaddress with IPV4_NETWORK algorithm" do
# The logstash config goes here.
# At this time, only filters are supported.