csv
The csv
formatter plugin output an event as CSV.
Parameters
fields (Array of String, Required. defaults to "\t"(TAB))
Specify output fields
delimiter (String, Optional. defaults to ",")
Delimiter for values.
force_quotes (Boolean, Optional, defaults to true)
If false, value won't be framed by quotes.
add_newline (Boolean, Optional, defaults to true)
Add \n
to the result.
include_time_key (Boolean, Optional, defaults to false)
If true, the time field (as specified by the time_key
parameter) is kept in the record.
time_key (String, Optional, defaults to "time")
The field name for the time key.
time_format (String. Optional)
By default, the output format is iso8601 (e.g. "2008-02-01T21:41:49"). One can specify their own format with this parameter.
include_tag_key (Boolean. Optional, defaults to false)
If true, the tag field (as specified by the tag_key
parameter) is kept in the record.
tag_key (String, Optional, defaults to "tag")
The field name for the tag key.
localtime (Boolean. Optional, defaults to true)
If true, use local time. Otherwise, UTC is used. This parameter is overwritten by the utc
parameter.
timezone (String. Optional)
By setting this parameter, one can parse the time value in the specified timezone. The following formats are accepted:
[+-]HH:MM (e.g. "+09:00")
[+-]HHMM (e.g. "+0900")
[+-]HH (e.g. "+09")
Region/Zone (e.g. "Asia/Tokyo")
Region/Zone/Zone (e.g. "America/Argentina/Buenos_Aires")
The timezone set in this parameter takes precedence over localtime
**, e.g., if localtime
is set to true
but timezone
is set to +0000
, UTC would be used.
Example
With this configuration:
This incoming event is formatted to:
With force_quotes false
, the result is:
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is a open source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.
Last updated