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

[7.x](backport #26419) Fix rfc5464 date parsing in the syslog input #26453

Merged
merged 1 commit into from
Jun 24, 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 @@ -217,6 +217,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix default config template values for paths on oracle module: {pull}26276[26276]
- Fix bug in aws-s3 input where the end of gzipped log files might have been discarded. {pull}26260[26260]
- Fix bug in `httpjson` that prevented `first_event` getting updated. {pull}26407[26407]
- Fix bug in the Syslog input that misparsed rfc5424 days starting with 0. {pull}26419[26419]

*Filebeat*

Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/syslog/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func bytesToInt(b []byte) int {

func skipLeadZero(b []byte) []byte {
if len(b) > 1 && b[0] == '0' {
return b[1:len(b)]
return b[1:]
}
return b
}
2 changes: 1 addition & 1 deletion filebeat/input/syslog/parser/syslog_rfc5424.rl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# timestamp
DATE_FULLYEAR = digit{4}>tok %year;
DATE_MONTH = (("0"[1-9]) | ("1"[0-2]))>tok %month_numeric;
DATE_MDAY = (([12][0-9]) | ("3"[01]))>tok %day;
DATE_MDAY = (("0"[1-9]) | ([12][0-9]) | ("3"[01]))>tok %day;
FULL_DATE = DATE_FULLYEAR "-" DATE_MONTH "-" DATE_MDAY;

TIME_HOUR = ([01][0-9] | "2"[0-3])>tok %hour;
Expand Down
Loading