class Fluent::Filter

Attributes

router[RW]

Public Class Methods

new() click to toggle source
Calls superclass method Fluent::PluginLoggerMixin.new
# File lib/fluent/filter.rb, line 25
def initialize
  super
end

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method Fluent::PluginLoggerMixin#configure
# File lib/fluent/filter.rb, line 29
def configure(conf)
  super

  if label_name = conf['@label']
    label = Engine.root_agent.find_label(label_name)
    @router = label.event_router
  elsif @router.nil?
    @router = Engine.root_agent.event_router
  end
end
filter(tag, time, record) click to toggle source
# File lib/fluent/filter.rb, line 46
def filter(tag, time, record)
  raise NotImplementedError, "Implement this method in child class"
end
filter_stream(tag, es) click to toggle source
# File lib/fluent/filter.rb, line 50
def filter_stream(tag, es)
  new_es = MultiEventStream.new
  es.each { |time, record|
    begin
      filtered_record = filter(tag, time, record)
      new_es.add(time, filtered_record) if filtered_record
    rescue => e
      router.emit_error_event(tag, time, record, e)
    end
  }
  new_es
end
shutdown() click to toggle source
# File lib/fluent/filter.rb, line 43
def shutdown
end
start() click to toggle source
# File lib/fluent/filter.rb, line 40
def start
end