-
Notifications
You must be signed in to change notification settings - Fork 75
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
feat(stdlib): Add main
log format to parse_nginx_log
function
#1202
feat(stdlib): Add main
log format to parse_nginx_log
function
#1202
Conversation
ccbe547
to
6996298
Compare
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.
Thank you @virtualtam! This mostly looks good. There's a failing test though.
6996298
to
39802b6
Compare
Thanks for the feedback @pront 👍 I have fixed the failing test, and the CI shows two unrelated failed tests (that seem to depend on the year the tests are being run?): ./scripts/vrl_tests.sh
# [...]
functions/parse_klog
valid.......................................................FAILED (expectation) {
"file": "klog.go",
"id": 28133,
"level": "info",
"line": 70,
"message": "hello from klog",
"timestamp": "2024-05-05T17:59:40.692994Z"
"timestamp": "2025-05-05T17:59:40.692994Z"
}
functions/parse_linux_authorization
parse authorization event...................................FAILED (expectation) {
"appname": "sshd",
"hostname": "localhost",
"message": "Accepted publickey for eng from 10.1.1.1 port 8888 ssh2: RSA SHA256:foobar",
"procid": 1111,
"timestamp": "2024-03-23T01:49:58Z"
"timestamp": "2025-03-23T01:49:58Z"
} EDIT: The two year-dependent failed tests were previously discussed in #8 and most recently bumped in #1203, so I'll just rebase this PR :) |
39802b6
to
022a5cf
Compare
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.
Thank you @virtualtam, this looks good. I would also add one more test case for invalid input.
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
022a5cf
to
e58d4b8
Compare
Thanks for the review @pront 👍 I have updated the PR with the following changes:
Additionally, I have signed the Vector CLA and will proceed to open a PR on the Vector repository to update usage documentation for the EDIT: PR adding documentation: vectordotdev/vector#22119 |
Awesome, thank you! 💭 It would be preferable if you don't force push to the branch in the future so I can do incremental reviews. But all good, I will schedule this PR for merging soon. |
I'm sorry for that, point taken for future PRs 👍 Maybe the incremental review workflow could be documented as part of the CONTRIBUTING guidelines for VRL/Vector to help new contributors? |
Good point, I will add this to the next batch of improvements. Thanks again @virtualtam! |
Summary
This PR adds support for the
main
log format toparse_nginx_logs
, which is defined by the default configuration file for official Nginx Docker images.Change Type
Is this a breaking change?
How did you test this PR?
main
log format for Nginx log linesDoes this PR include user facing changes?
our guidelines.
Checklist
run
dd-rust-license-tool write
and commit the changes. More details here.PR adding documentation: vectordotdev/vector#22119
References
Closes #1201
Notes for reviewers
timestamp
field, the name of the parsed fields match the name of the fields as defined by the Nginx log format (see VRL: addmain
log format forparse_nginx_log
#1201 and reference links)