-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new mode to multiline reader to aggregate constant number of lines #18352
Conversation
Pinging @elastic/integrations-services (Team:Services) |
💔 Build FailedExpand to view the summary
Build stats
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
if config.Type == patternMode || config.Type == nil { | ||
return newMultilinePatternReader(r, separator, maxBytes, config) | ||
} else if config.Type == countMode { | ||
return newMultilineCountReader(r, separator, maxBytes, config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it is needed to introduce a complete new reader. Some small modifications to the existing multline-reader will do exactly what is requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not introducing a new type. Only the validation of the config options is separated.
7a3f738
to
6619106
Compare
Reading through the state machine I wonder if |
@@ -163,6 +203,68 @@ func (mlr *Reader) readFirst() (reader.Message, error) { | |||
} | |||
} | |||
|
|||
func (mlr *Reader) readFirstCount() (reader.Message, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the pattern matcher we need readFirst
, because we don't want to validate against the line against the regular expression yet. But I don't think we need readFirstCount
. We always check for the number of lines and create an event once the amount of lines have been reached.
8adf22b
to
3592c83
Compare
3592c83
to
eb91372
Compare
e4b0bcd
to
914129f
Compare
06a04dd
to
c6a5a66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Feel free to merge after fixing the panic.
2eaa696
to
7da05b6
Compare
elastic#18352) ## What does this PR do? This PR adds a new mode for the multiline reader of Libbeat (exposed in Filebeat). The new mode lets users to aggregate the configured number of lines into a single event. Example configuration to aggregate 5 lines: ```yaml muliline.type: count multiline.count_lines: 5 ``` This PR also adds a new configuration option `skip_newline`. If set, Filebeat does not add a newline when two events are concatenated. Closes elastic#18038 (cherry picked from commit e3f51ab)
…ate constant number of lines (#19243) * Add new mode to multiline reader to aggregate constant number of lines (#18352) ## What does this PR do? This PR adds a new mode for the multiline reader of Libbeat (exposed in Filebeat). The new mode lets users to aggregate the configured number of lines into a single event. Example configuration to aggregate 5 lines: ```yaml muliline.type: count multiline.count_lines: 5 ``` This PR also adds a new configuration option `skip_newline`. If set, Filebeat does not add a newline when two events are concatenated. Closes #18038 (cherry picked from commit e3f51ab)
elastic#18352) ## What does this PR do? This PR adds a new mode for the multiline reader of Libbeat (exposed in Filebeat). The new mode lets users to aggregate the configured number of lines into a single event. Example configuration to aggregate 5 lines: ```yaml muliline.type: count multiline.count_lines: 5 ``` This PR also adds a new configuration option `skip_newline`. If set, Filebeat does not add a newline when two events are concatenated. Closes elastic#18038
What does this PR do?
This PR adds a new mode for the multiline reader of Libbeat (exposed in Filebeat). The new mode lets users to aggregate the configured number of lines into a single event.
Example configuration to aggregate 5 lines:
This PR also adds a new configuration option
skip_newline
. If set, Filebeat does not add a newline when two events are concatenated.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Closes #18038