-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Filebeat] Fix RFC5424 date format in system/syslog in pipeline #12529
Merged
adriansr
merged 5 commits into
elastic:master
from
adriansr:fix-filebeat-syslog-tzformat
Jun 14, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1986-04-26T01:23:45.101+0400 rmbkmonitor04 shutdown[2649]: shutting down for system halt | ||
1986-04-26T01:23:45.388424+04:00 rmbkmonitor04 thermald: constraint_0_power_limit_uw exceeded. |
31 changes: 31 additions & 0 deletions
31
filebeat/module/system/syslog/test/tz-offset.log-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[ | ||
{ | ||
"@timestamp": "1986-04-25T21:23:45.101Z", | ||
"event.dataset": "system.syslog", | ||
"event.module": "system", | ||
"event.timezone": "+00:00", | ||
"fileset.name": "syslog", | ||
"host.hostname": "rmbkmonitor04", | ||
"input.type": "log", | ||
"log.file.path": "tz-offset.log", | ||
"log.offset": 0, | ||
"message": "shutting down for system halt", | ||
"process.name": "shutdown", | ||
"process.pid": 2649, | ||
"service.type": "system" | ||
}, | ||
{ | ||
"@timestamp": "1986-04-25T21:23:45.388Z", | ||
"event.dataset": "system.syslog", | ||
"event.module": "system", | ||
"event.timezone": "+00:00", | ||
"fileset.name": "syslog", | ||
"host.hostname": "rmbkmonitor04", | ||
"input.type": "log", | ||
"log.file.path": "tz-offset.log", | ||
"log.offset": 89, | ||
"message": "constraint_0_power_limit_uw exceeded.", | ||
"process.name": "thermald", | ||
"service.type": "system" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a bit hacky but I think for now we don't have choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely hacky :)
Note to reviewers: This is needed because in most syslog logs, the year is missing from the timestamp, so Elasticsearch will set it to the current year and that will cause the tests to fail every new year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah should the explanation you gave be in the comment in the code? This is hacky enough after a while we probably won't remember why it's added 😄(If there is no better solution.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right!