Sha256: 08b47dbe44ecdcbf92c8fdd7e537ea8fa95325edc29a3aef7a9bf9e522f2adb4

Contents?: true

Size: 919 Bytes

Versions: 3

Compression:

Stored size: 919 Bytes

Contents

require 'fluent/plugin/in_tail'

module Fluent
  class NewNewTailInput < NewTailInput

    Plugin.register_input('tail_multiline_extended', self)

    def parse_multilines(lines, tail_watcher)
      if @parser.has_splitter?
        es = MultiEventStream.new
        tail_watcher.line_buffer_timer_flusher.reset_timer if tail_watcher.line_buffer_timer_flusher
        lb = tail_watcher.line_buffer.to_s + (lines.is_a?(Array) ? lines.select {|e| e.is_a?(String)}.join('') : '')
        tail_watcher.line_buffer = ''

        if not lb.empty?
          events = @parser.splitter(lb)
          tail_watcher.line_buffer = events.pop
          events.each do |event|
            @parser.parse(event) do |time, record|
              convert_line_to_event(event, es, tail_watcher) if time && record
            end
          end
        end
        es
      else
        super(lines, tail_watcher)
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluent-plugin-multiline-extended-1.0.3 lib/fluent/plugin/in_tail_multiline_extended.rb
fluent-plugin-multiline-extended-1.0.2 lib/fluent/plugin/in_tail_multiline_extended.rb
fluent-plugin-multiline-extended-1.0.1 lib/fluent/plugin/in_tail_multiline_extended.rb