fluent-plugin-record-modifier icon indicating copy to clipboard operation
fluent-plugin-record-modifier copied to clipboard

New parameter `replace_keys`:

Open alexfouche opened this issue 7 years ago • 1 comments

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

alexfouche avatar Jun 12 '17 15:06 alexfouche

Could you add test?

repeatedly avatar Jun 14 '17 14:06 repeatedly