We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following record:
{ "hostname":"buster", "priority":"6", "selinux_context":"unconfined\n", "pid":"4866", "image_name":"nginx", "container_name":"fluentd-docker_nginx_1", "container_id":"109e52fb8de8", "message":{ "remote":"172.20.0.1", "host":"-", "user":"-", "method":"GET", "path":"/", "code":"200", "size":"612", "referer":"-", "agent":"curl/7.64.0", "http_x_forwarded_for":"-" }, "source_realtime_timestamp":"1569258331312517" }
I would be nice to access the flieds in message fields in CSV format
message
<filter **> @type parser key_name message reserve_data true hash_value_field message <parse> @type regexp expression /^(?<method>[^ ]*) (?<path>[^ ]*) (?<code>[0-9]*) (?<ms>[^ ]*) ms - (?<bytes_out>[0-9-]*)$/ </parse> </filter> <match **> #@type file @type stdout #path /tmp/access.log <format> @type csv force_quotes false delimiter " " fields container_tag,message['method'] </format> </match>
I have tried message['method'] message.method and message[:method] none of them works
message['method']
message.method
message[:method]
The text was updated successfully, but these errors were encountered:
Because ruby's CSV module doesn't support nested field. To support nested field, need to create target array before passing to CSV module.
Sorry, something went wrong.
formatter_csv: support nested fields. fix #2630
dc86f7d
Signed-off-by: Masahiro Nakagawa <[email protected]>
Patch: #2643
Merge pull request #2643 from fluent/csv-formatter-nested-fields
a72a0a4
Successfully merging a pull request may close this issue.
Consider the following record:
I would be nice to access the flieds in
message
fields in CSV formatI have tried
message['method']
message.method
andmessage[:method]
none of them worksThe text was updated successfully, but these errors were encountered: