fluent-plugin-record-modifier
fluent-plugin-record-modifier copied to clipboard
replace is adding two copies of string
fluentd:1.11.2 fluent-plugin-record-modifier:2.1.0
Config:
<filter foo-api.**>
@type record_transformer
<record>
ecs_container_id "foo-api-#{Socket.gethostname}"
</record>
</filter>
<filter foo-api.**>
@type record_modifier
<replace>
key ecs_container_id
expression /.*/
replace foo-api-testing
</replace>
</filter>
So I create a new field called "ecs_container_id" and set it to "foo-api-#{Socket.gethostname}" and this works.
As a test I then try to use the replace functionality (just to prove it works) to change that to "foo-api-testing". When doing this it writes two copies of the string in the new field so the value is:
foo-api-testingfoo-api-testing