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

Add null (\u0000) as a valid line terminator #28998

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Replace usages of `host.user.*` fields with `user.*` in `cisco`, `microsoft` and `oracle` modules. {pull}28620[28620]
- Remove `docker` input. Please use `filestream` input with `container` parser or `container` input. {pull}28817[28817]
- Change `threatintel` module to use new `threat.*` ECS fields. {pull}29014[29014]
- `filestream` and `log` inputs accept null (`\u0000`) as line terminator. {pull}28998[28998]

*Heartbeat*

Expand Down
6 changes: 4 additions & 2 deletions filebeat/_meta/config/filebeat.inputs.reference.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ filebeat.inputs:
#max_bytes: 10485760

# 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.
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator,
# null_terminator
#line_terminator: auto

### Recursive glob configuration
Expand Down Expand Up @@ -348,7 +349,8 @@ filebeat.inputs:
#message_max_bytes: 10485760

# 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.
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator,
# null_terminator
#line_terminator: auto

# The ingest pipeline ID associated with this input. If this is set, it
Expand Down
6 changes: 4 additions & 2 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ filebeat.inputs:
#max_bytes: 10485760

# 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.
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator,
# null_terminator
#line_terminator: auto

### Recursive glob configuration
Expand Down Expand Up @@ -755,7 +756,8 @@ filebeat.inputs:
#message_max_bytes: 10485760

# 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.
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator,
# null_terminator
#line_terminator: auto

# The ingest pipeline ID associated with this input. If this is set, it
Expand Down
4 changes: 4 additions & 0 deletions libbeat/reader/readfile/line_terminator.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const (
LineSeparator
// ParagraphSeparator is the unicode char PS
ParagraphSeparator
// NullTerminator
NullTerminator
)

var (
Expand All @@ -57,6 +59,7 @@ var (
"next_line": NextLine,
"line_separator": LineSeparator,
"paragraph_separator": ParagraphSeparator,
"null_terminator": NullTerminator,
}

lineTerminatorCharacters = map[LineTerminator][]byte{
Expand All @@ -69,6 +72,7 @@ var (
NextLine: []byte{'\u0085'},
LineSeparator: []byte("\u2028"),
ParagraphSeparator: []byte("\u2029"),
NullTerminator: []byte{'\u0000'},
}
)

Expand Down
6 changes: 4 additions & 2 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2489,7 +2489,8 @@ filebeat.inputs:
#max_bytes: 10485760

# 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.
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator,
# null_terminator
#line_terminator: auto

### Recursive glob configuration
Expand Down Expand Up @@ -2743,7 +2744,8 @@ filebeat.inputs:
#message_max_bytes: 10485760

# 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.
# carriage_return, carriage_return_line_feed, next_line, line_separator, paragraph_separator,
# null_terminator
#line_terminator: auto

# The ingest pipeline ID associated with this input. If this is set, it
Expand Down