Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/logstash/codecs/multiline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ module LogStash module Codecs class Multiline < LogStash::Codecs::Base
# auto_flush_interval. No default. If unset, no auto_flush. Units: seconds
config :auto_flush_interval, :validate => :number

# Whether to split original message to lines.
config :split_original, :validate => :boolean, :default => true

public

def register
Expand Down Expand Up @@ -188,7 +191,9 @@ def accept(listener)

def decode(text, &block)
text = @converter.convert(text)
text.split("\n").each do |line|

lines = @split_original ? text.split("\n") : [text]
lines.each do |line|
match = @grok.match(line)
@logger.debug("Multiline", :pattern => @pattern, :text => line,
:match => !match.nil?, :negate => @negate)
Expand Down Expand Up @@ -263,7 +268,7 @@ def do_previous(text, matched, &block)
end

def over_maximum_lines?
@buffer.size > @max_lines
@buffer.size >= @max_lines
end

def over_maximum_bytes?
Expand Down