class Fluent::Plugin::PANAnonymizerFilter

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/fluent/plugin/filter_pan_anonymizer.rb, line 16
def initialize
  super
end

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/filter_pan_anonymizer.rb, line 20
def configure(conf)
  super

  @pan_masker = @pan_configs.map do |i|
    i[:formats].map do |format|
      Fluent::PAN::Masker.new(format, i[:checksum_algorithm], i[:mask], i[:force])
    end
  end.flatten
end
filter(tag, time, record) click to toggle source
# File lib/fluent/plugin/filter_pan_anonymizer.rb, line 30
def filter(tag, time, record)
  record.map do |key, value|
    if @ignore_keys.include? key.to_s
      [key, value]
    else
      _value = value
      @pan_masker.each do |i|
        _value = i.mask_if_found_pan(_value)
      end
      [key, _value]
    end
  end.to_h
end