Class: Fluent::Plugin::SplitStringFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/fluent/plugin/filter_split_string.rb

Instance Method Summary collapse

Instance Method Details

#filter_stream(tag, event_stream) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# 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