Disable time and tags in fluentd stdout output plugin
Asked Answered
S

2

6

Remove time and tag from fluentd output plugin stdout with json

Fluentd's output plugin produces output like:

2017-11-28 11:43:13.814351757 +0900 tag: {"field1":"value1","field2":"value2"}

So timestamp and tag are before the json. How can I remove these fields - I only like to have the json output

<match pattern>
  @type stdout
</match>

expected output: {"field1":"value1","field2":"value2"}

Sardonyx answered 29/8, 2019 at 23:24 Comment(2)
Were you able to resolve this? I am facing the same issue and have been unsuccessful in addressing the issueMalaspina
Hi @Sardonyx did you manage solving this?Increate
U
3

Set the json format type which by default doesn't includes time and tag in output:

<match pattern>
  @type stdout
  <format>
    @type json
  </format>
</match>
Unburden answered 4/2, 2020 at 14:34 Comment(0)
G
0

Did you try filters?

<filter pattern>
  @type record_transformer
  <record>
      ${tag}
  </record>
</filter>
Guanabara answered 30/8, 2019 at 2:38 Comment(3)
no still the same behaviour. I hope there is a way to change the pattern of the output plugin, by default json format does not add these fields but the stdout plugin does referring to the manual.Sardonyx
Seems like the opposite what the OP was asking, but exactly what I was looking for. Thank you.Banded
time and tag are not parts of record. that's why this won't work. @type stdout automatically adds time and tag to each line on its own.Tumbling

© 2022 - 2024 — McMap. All rights reserved.