-
Notifications
You must be signed in to change notification settings - Fork 254
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 windowsevent stage loki process #2545
Merged
Merged
Conversation
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
💻 Deploy preview deleted. |
7c88f59
to
24b6f7b
Compare
mattdurham
reviewed
Jan 27, 2025
mattdurham
reviewed
Jan 27, 2025
mattdurham
reviewed
Jan 27, 2025
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.
Few comments but overall looks solid.
mattdurham
approved these changes
Jan 27, 2025
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.
lgtm
Hello, this is my windows eventlog processing pipeline:
Not sure if this helps or not.
|
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
Co-authored-by: Clayton Cornell <[email protected]>
clayton-cornell
approved these changes
Feb 3, 2025
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.
PR Description
The existing eventlogmessage stage has a few parsing flaws that cannot be addressed without breaking changes (see the issue linked).
This is why I decided to create a new stage "windowsevent" which covers the same functionality and has the same arguments as the existing eventlogmessage, except that it parses the message differently.
New parsing logic:
The
windowsevent
stage expects the message to be structured in sections that are split by empty lines.The first section of the input is treated as a whole block and stored in the extracted map with the key
Description
.Sections following the
Description
are expected to contain key-value pairs in the format key: value.If the first line of a section has no value (e.g., "Subject:"), the key will act as a prefix for subsequent keys in the same section.
If a line within a section does not include the
:
symbol, it is considered part of the previous entry's value. The line is appended to the previous value, separated by a comma.Lines in a section without a preceding valid entry (key-value pair) are ignored and discarded.
I scrolled through Windows events on my personal computer to get some examples. You can check the example in the doc and in the tests to see the results.
Which issue(s) this PR fixes
Fixes #2337
Notes to the Reviewer
PR Checklist