class Fluent::Plugin::SplitStringFilter

Public Instance Methods

filter_stream(tag, event_stream) click to toggle source
# File lib/fluent/plugin/filter_split_string.rb, line 7
def filter_stream(tag, event_stream)
  new_event_stream = Fluent::MultiEventStream.new

  event_stream.each do |time, record|
    record["message"].split('\n').each do |line|
      new_event_stream.add(time, record.merge({"message" => line}))
    end
  end

  new_event_stream
end