Return None instead of skipping lines without timestamp in year_rollo…#1753
Open
EmperorValkorion wants to merge 1 commit into
Open
Return None instead of skipping lines without timestamp in year_rollo…#1753EmperorValkorion wants to merge 1 commit into
EmperorValkorion wants to merge 1 commit into
Conversation
Contributor
Yes, this method was not created with multi-line log messages in mind, but for structured log messages. If a structured log message is malformed we chose to discard it as the forensic value of the record can not be determined without manual review (e.g. we do not know what part of the record was malformed). Yielding the message without a timestamp seems fine to me, I do not have a strong opinion on that. The previous behavior was mainly intended to catch the attention of the user - hopefully causing them to investigate and either 1) fix the parser or 2) conclude the log is partially corrupted. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Yield ts as None instead of skipping lines in year_rollover_helper that have no timestamp
This way the helper is also compatible with multiline logs. Also updated test_messages.py, since the new logic caused the number of results for the year_rollover tests to change from 2 to 3. Maybe worth looking into if messages plugin should be updated with the new logic. @JSCU-CNI was there a reason that the original implemention skipped lines without a valid timestamp fully instead of just yielding ts as None?