class Fluent::Plugin::SplitEventFilter

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/filter_split_event.rb, line 10
def configure(conf)
  super
end
filter_stream(tag, es) click to toggle source
# File lib/fluent/plugin/filter_split_event.rb, line 14
def filter_stream(tag, es)
  new_es = Fluent::MultiEventStream.new

  es.each do |time, record|
    begin
      if record.key?(@field)
        vals = record[@field].split(@terminator)

        if vals.count > 1
          vals.each do |v|
            new_record = record.dup
            new_record[@field] = v.strip

            new_es.add(time, new_record)
          end
        else
          new_es.add(time, record)
        end
      end
    rescue => e
      router.emit_error_event(tag, time, record, e)
    end
  end

  return new_es
end