in_splunk: add ability to map records from specific tokens to specific tags #9831
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.
Splunk HEC logging is usually set up in a manner where data sent in using particular HEC tokens is indexed in particular spots or ways - see https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/Data/UsetheHTTPEventCollector#How_the_Splunk_platform_uses_HTTP_Event_Collector_tokens_to_get_data_in . This often means using many HEC tokens for many different sources of data.
To support logging sources following this pattern better I have updated the
in_splunk
plugin to allow specifying tag mapping rules that will set the fluent tag for incoming records sent with a particular HEC token value to a particular configured tag value.You can kind of already do this in a bootleg manner by using the
rewrite_tag
plugin combined with putting the HEC token in the log record, but it involves introducing a new input emitter and buffer, as well as storing the potentially sensitive tag values in the record. This can be cut out all together if the right tag can be set on the way in through the splunk input plugin.Testing
cURL test commands:
Fluentbit output:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Happy to add docs for this but would like to get approval on the PR and general approach first.
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.