Configurable line terminator#11015
Conversation
|
jenkins test this |
8583743 to
cf0da81
Compare
|
jenkins test this |
1 similar comment
|
jenkins test this |
6356a98 to
22089aa
Compare
|
jenkins test this |
3d5cab1 to
e472e04
Compare
urso
left a comment
There was a problem hiding this comment.
Looks like a breaking change. Old behavior did support \r\n and \n based line terminators. It used to split on \n first and remove trailing \r\n or \n characters from the line.
This change seems to make it 'less' dynamic and this sense. What will be the default for Windows where \r\n is more common?
|
It is indeed less dynamic. This PR requires the input file to use one kind of newline. Previously the following input file was readable: Also if someone has different files with different newlines, e.g. and he/she was able to add it to the same input. By default on Windows the configured newline is To make the configuration backward compatible, a new option |
|
SGTM. Alternatively we can have 2 patterns. One 'split' pattern and one 'right-trim' pattern. This way we're not limited to newlines anymore, but could support more complex patterns for split based multiline. |
e472e04 to
1340348
Compare
This PR add a new input configuration option named
line_terminator:The option
autotells Filebeat to use our current hybrid new line finder approach. Thus, we can avoid introducing a breaking change.It also contains a minor refactoring in
readfilepackage. I have created a new typeConfigwhich stores the configuration of the readers of the package. This eliminates a long list of parameters in the constructors ofEncodeReaderandLineReader.Closes #5500