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

replace is adding two copies of string

Open SnazzyBootMan opened this issue 3 years ago • 0 comments

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

SnazzyBootMan avatar Sep 14 '21 16:09 SnazzyBootMan