Config: Format Section
Some of the Fluentd plugins support the <format> section to specify how to format the record.
Format Section Overview
The format section can be under <match> or <filter> section.
<match tag.*>
@type file
# ...
<format>
# ...
</format>
</match>Formatter Plugin Type
The @type parameter of <format> section specifies the type of the formatter plugin. Fluentd core bundles some useful formatter plugins.
<format>
@type json
</format>Here's the list of built-in formatter plugins:
Third-party plugins may also be installed and configured.
For more details, see plugins documentation.
Parameters
@type
@typeThe @type parameter specifies the type of the formatter plugin.
<format>
@type csv
# ...
</format>Time Parameters
time_type(enum) (optional): parses/formats value according to thistype
Default:
floatAvailable values:
float,unixtime,stringfloat: seconds from Epoch + nano seconds (e.g.1510544836.154709804)
unixtime: seconds from Epoch (e.g. 1510544815)string: use format specified bytime_format, local time or timezone
time_format(string) (optional): processes value according to thespecified format. This is available only when
time_typeisstring.Default:
nilAvailable time format:
For more details about formatting, see
For more details about parsing, see
%iso8601(only for parsing)Use
%Nto parse/format with sub-second precision, becausestrptimedoes not support%3N,%6N,%9N, and%L.
localtime(bool) (optional): iftrue, uses local time. Otherwise,UTC is used. This is exclusive with
utc.Default:
true
utc(bool) (optional): iftrue, uses UTC. Otherwise, local time isused. This is exclusive with
localtime.Default:
false
timezone(string) (optional): uses the specified timezone. One canparse/format the time value in the specified timezone format.
Default:
nilAvailable time zone format:
[+-]HH:MM(e.g. "+09:00") (recommended)[+-]HHMM(e.g. "+0900")[+-]HH(e.g. "+09")Region/Zone (e.g.
Asia/Tokyo)Region/Zone/Zone (e.g.
America/Argentina/Buenos_Aires)
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.
Last updated
Was this helpful?