Parsing Nested Json Log #4077
Unanswered
allahshukur-ahmadzada
asked this question in
Q&A
Replies: 1 comment
-
The For example, we can format the parsed JSON log by using fitler_record_transformer as follows Example 1Config <source>
@type tcp
tag test
<parse>
@type json
</parse>
</source>
<filter test.**>
@type record_transformer
enable_ruby true
<record>
fuga ${record.dig("hoge", "fuga")}
</record>
</filter>
<match test.**>
@type stdout
<format>
@type csv
fields fuga, foo
</format>
</match> Send nested JSON $ netcat 0.0.0.0 5170
{"hoge":{"fuga":1},"foo":2} Result
Example 2Config <source>
@type tcp
tag test
<parse>
@type json
</parse>
</source>
<filter test.**>
@type record_transformer
enable_ruby true
renew_record true
<record>
fuga ${record.dig("hoge", "fuga")}
foo ${record["foo"]}
</record>
</filter>
<match test.**>
@type stdout
</match> Send nested JSON $ netcat 0.0.0.0 5170
{"hoge":{"fuga":1},"foo":2} Result
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can fluentd parse nested json log? if yes can anyone share an exmple? like at the fields should be nested, host.name , host.os and so on
Beta Was this translation helpful? Give feedback.
All reactions