Class: Fluent::AnonymizerOutput

Inherits:
Output
  • Object
show all
Includes:
HandleTagNameMixin, Mixin::RewriteTagName, SetTagKeyMixin
Defined in:
lib/fluent/plugin/out_anonymizer.rb

Instance Method Summary collapse

Constructor Details

#initializeAnonymizerOutput

Returns a new instance of AnonymizerOutput.



33
34
35
36
# File 'lib/fluent/plugin/out_anonymizer.rb', line 33

def initialize
  require 'fluent/plugin/anonymizer'
  super
end

Instance Method Details

#configure(conf) ⇒ Object



38
39
40
41
42
# File 'lib/fluent/plugin/out_anonymizer.rb', line 38

def configure(conf)
  log.warn "out_anonymizer is now deprecated. It will be removed in a future release. Please consider to use filter_anonymizer."
  super
  @anonymizer = Fluent::Anonymizer.new(self, conf)
end

#emit(tag, es, chain) ⇒ Object



44
45
46
47
48
49
50
51
52
# File 'lib/fluent/plugin/out_anonymizer.rb', line 44

def emit(tag, es, chain)
  es.each do |time, record|
    record = @anonymizer.anonymize(record)
    emit_tag = tag.dup
    filter_record(emit_tag, time, record)
    router.emit(emit_tag, time, record)
  end
  chain.next
end