class Fluent::Plugin::SplitArrayFilter

Public Instance Methods

filter_stream(tag, es) click to toggle source
# File lib/fluent/plugin/filter_split_array.rb, line 10
def filter_stream(tag, es)
  new_es = Fluent::MultiEventStream.new
  es.each {|time, record|
    target_record = @split_key.nil? ? record : record[@split_key] || {}
    split(time, target_record, new_es)
  }
  new_es
end

Private Instance Methods

split(time, record, new_es) click to toggle source
# File lib/fluent/plugin/filter_split_array.rb, line 21
def split(time, record, new_es)
  if record.instance_of?(Array)
    record.each { |r| new_es.add(time, r) }
  else
    new_es.add(time, record)
  end
end