New parameter replace_keys
:
#19
Open
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.
Whether to replace a key or not if already in the record. Defaults to true to preserve compatibility
Use case:
I use the record modifier filter to add an hostname key in the record, then forwards record to another Fluentd. Which itself also tails its logs besides collecting records from other Fluentd. But since it tails its own log, i also added the record modifier to set the hostname. This has the side effect of replacing the hostname key of all collected records from other fluentd on other hosts with its hostname.
Thus, i added a boolean flag to prevent overwriting a key (in this example the hostname) if the record already has the key