-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(splunk_hec source): Allow content-type header if it includes application/json #23024
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
base: master
Are you sure you want to change the base?
Conversation
…ication/json. Do not require exact match
…same error response
Sorry, I clearly don't know how to read or make a title |
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.
Hi @tot19, this changes makes sense to me. Some tests are failing though and will need to be fixed. Also, please include a changelog. The PR description has some great info, we can reuse those for the changelog.
Thanks for the review @pront! Added the changelog in subsequent commit. I believe the other test failures came from the bad PR title. |
Working on failed unit tests |
Ok, all tests are passing now as well as formatting. I also added a new test to ensure the new behavior is enforced. Thanks again for your patience @pront.
|
Summary
Updated the Splunk HEC source to accept requests that contain the header content-type with any value containing "application/json," not the exact value of "application/json." This matches the behavior of a true Splunk HEC. Allows sources from AWS to successfully send events to the Splunk HEC source without additional proxying to update headers.
Change Type
Is this a breaking change?
How did you test this PR?
Against Vector before change ack disabled:
Against Vector after change ack disabled:
Against Splunk HEC:
Against Vector after change ack enabled:
Against Vector before change bad header:
Against Vector after change bad header:
Does this PR include user facing changes?
Notes
@vectordotdev/vector
to reach out to us regarding this PR.pre-push
hook, please see this template.cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace
(alternatively, you can runcargo test --all
)./scripts/check_changelog_fragments.sh
git merge origin master
andgit push
.Cargo.lock
), pleaserun
cargo vdev build licenses
to regenerate the license inventory and commit the changes (if any). More details here.References
Closes #23023