From 844d699fda107fd00dc54bcc8f1f6222199f8184 Mon Sep 17 00:00:00 2001 From: Hiroaki Sano Date: Wed, 26 Dec 2018 20:53:04 +0900 Subject: [PATCH] Fix bug #3 --- lib/fluent/plugin/filter_pan_anonymizer.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/filter_pan_anonymizer.rb b/lib/fluent/plugin/filter_pan_anonymizer.rb index be83696..4394434 100644 --- a/lib/fluent/plugin/filter_pan_anonymizer.rb +++ b/lib/fluent/plugin/filter_pan_anonymizer.rb @@ -20,8 +20,13 @@ def initialize def configure(conf) super + formats = conf.each_element.map do |i| + next if i["formats"].nil? + i["formats"].scan(/\/[^\/]*\//).map do |j| j.delete("/") end.map do |j| Regexp.new(j) end + end.flatten + @pan_masker = @pan_configs.map do |i| - i[:formats].map do |format| + formats.map do |format| Fluent::PAN::Masker.new(format, i[:checksum_algorithm], i[:mask], i[:force]) end end.flatten