Skip to content
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

Support \r as line separator #5500

Closed
jguay opened this issue Nov 2, 2017 · 0 comments · Fixed by #11015
Closed

Support \r as line separator #5500

jguay opened this issue Nov 2, 2017 · 0 comments · Fixed by #11015
Assignees

Comments

@jguay
Copy link
Contributor

jguay commented Nov 2, 2017

  • Version: 5.6.3
  • Operating System: limitation reproduced on Mac and Linux
  • Current behaviour :
    Filebeat looks for \n or \r\n to split the lines (LF and CR+LF)
  • Requested behaviour :
    Ability to specify newline separator (similar to logstash file input separator) or native support for following separators (extract from https://en.wikipedia.org/wiki/Newline):
The Unicode standard defines a number of characters that conforming applications should recognize as line terminators:

 LF:    Line Feed, U+000A
 VT:    Vertical Tab, U+000B
 FF:    Form Feed, U+000C
 CR:    Carriage Return, U+000D
 CR+LF: CR (U+000D) followed by LF (U+000A)
 NEL:   Next Line, U+0085
 LS:    Line Separator, U+2028
 PS:    Paragraph Separator, U+2029
@kvch kvch self-assigned this Feb 28, 2019
kvch added a commit that referenced this issue Apr 15, 2019
This PR add a new input configuration option named `line_terminator`:

```
# Characters which separate the lines. Valid values: auto, line_feed, vertical_tab, form_feed,
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator.
#line_terminator: auto
```
The option `auto` tells 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 `readfile` package. I have created a new type `Config` which stores the configuration of the readers of the package. This eliminates a long list of parameters in the constructors of `EncodeReader` and `LineReader`.


Closes #5500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants