Class: Fluent::Plugin::UniformFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/fluent/plugin/filter_uniform.rb

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



30
31
32
33
34
# File 'lib/fluent/plugin/filter_uniform.rb', line 30

def configure(conf)
  super
  @maps = conf['maps'].map {|k| k.downcase}
  @to_lower = conf['to_lower']
end

#filter(tag, time, record) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fluent/plugin/filter_uniform.rb', line 36

def filter(tag, time, record)
  super
  out = {}
  record.each{ |key, value|
    if @maps.include? key.downcase
      if @to_lower
        out[key.downcase] = value
      else
        out[key] = value
      end
    end
  }
  out
end