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

[8.13](backport #38982) [libbeat] Fix parsing of RFC 3164 process IDs in syslog processor #39123

Merged
merged 1 commit into from
Apr 22, 2024
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 @@ -56,6 +56,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Change cache processor documentation from `write_period` to `write_interval`. {pull}38561[38561]
- Fix cache processor expiries heap cleanup on partial file writes. {pull}38561[38561]
- Fix cache processor expiries infinite growth when large a large TTL is used and recurring keys are cached. {pull}38561[38561]
- Fix parsing of RFC 3164 process IDs in syslog processor. {issue}38947[38947] {pull}38982[38982]

*Auditbeat*

Expand Down
2 changes: 1 addition & 1 deletion libbeat/reader/syslog/parser/rfc3164.rl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
hostname = graph+ >tok %set_hostname;

tag = (print -- [ :\[])+ >tok %set_tag;
content_value = print+ >tok %set_content;
content_value = digit+ >tok %set_content;
content = '[' content_value ']';
msg = (tag content? ':' sp)? any+ >tok %set_msg;
}%%
60 changes: 5 additions & 55 deletions libbeat/reader/syslog/rfc3164_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions libbeat/reader/syslog/rfc3164_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ func TestParseRFC3164(t *testing.T) {
msg: "message",
},
},
"ok-procid-with-square-brackets-msg": {
in: "<114>Apr 12 13:30:01 aaaaaa001.adm.domain aaaaaa001[25259]: my.some.domain 10.11.12.13 - USERNAME [12/Apr/2024:13:29:59.993 +0200] /skodas \"GET /skodas/group/pod-documentation/aaa HTTP/1.1\" 301 301 290bytes 1 10327",
want: message{
timestamp: mustParseTime(time.Stamp, "Apr 12 13:30:01", time.Local),
priority: 114,
facility: 14,
severity: 2,
hostname: "aaaaaa001.adm.domain",
process: "aaaaaa001",
pid: "25259",
msg: "my.some.domain 10.11.12.13 - USERNAME [12/Apr/2024:13:29:59.993 +0200] /skodas \"GET /skodas/group/pod-documentation/aaa HTTP/1.1\" 301 301 290bytes 1 10327",
},
},
"err-pri-not-a-number": {
in: "<abc>Oct 11 22:14:15 test-host this is the message",
want: message{
Expand Down
Loading