<parse>
section to specify how to parse the raw data.<source>
, <match>
or <filter>
section. It is enabled for the plugins that support parser plugin features.@type
parameter of <parse>
section specifies the type of the parser plugin. Fluentd core bundles some useful parser plugins.@type
@type
parameter specifies the type of the parser plugin.types
(hash) (optional): Specify types for converting field into anothernil
types user_id:integer,paid:bool,paid_usd_amount:float
null_value_pattern
(regexp) (optional): Specify null value pattern.nil
null_empty_string
(bool) (optional): If true
, empty string field isnil
.false
estimate_current_event
(bool) (optional): If true
, useFluent::EventTime.now
(current time) as a timestamp when time_key
istrue
keep_time_key
(bool) (optional): If true
, keep time field in thefalse
timeout
(time) (optional): Specify timeout for parse
processing. Thisnil
types
Parametertypes
parameter, the following types are supported:string
: Converts the field into String
type. This uses to_s
method for conversion.bool
: Converts the string "true"
, "yes"
or "1"
into true
. Otherwise, false
.integer
(not int
): Converts the field into the Integer
type. This uses to_i
method for conversion. For example, the string "1000"
converts into 1000
.float
: Converts the field into Float
type. This uses to_f
method for conversion. For example, the string "7.45"
converts into 7.45
.time
: Converts the field into Fluent::EventTime
type. This uses Fluentd time parser for conversion. For the time
type, the third field specifies the time format similar to time_format
.time_type
and time_format
parameters in Time parameters
section.array
: Converts the string field into Array
type. For the array
type, the third field specifies the delimiter (the default is comma ","
). For example, if a field item_ids
contains the value "3,4,5"
, types item_ids:array
parses it as ["3", "4", "5"]
. Alternatively, if the value is "Adam|Alice|Bob"
, types item_ids:array:|
parses it as ["Adam", "Alice", "Bob"]
.time_type
(enum) (optional): parses/formats value according to thisstring
float
, unixtime
, string
, mixed
float
: seconds from Epoch + nano seconds (e.g.unixtime
: seconds from Epoch (e.g. 1510544815)string
: use format specified by time_format
, local time or timemixed
: enable time_format_fallbacks
option. (Since Fluentd v1.12.2)time_format
(string) (optional): processes value according to thetime_type
is string
.nil
%iso8601
(only for parsing)%N
to parse/format with sub-second precision, because%3N
, %6N
, %9N
, and %L
.localtime
(bool) (optional): if true
, uses local time. Otherwise,utc
.true
utc
(bool) (optional): if true
, uses UTC. Otherwise, local time islocaltime
.false
timezone
(string) (optional): uses the specified timezone. One cannil
[+-]HH:MM
(e.g. "+09:00") (recommended)[+-]HHMM
(e.g. "+0900")[+-]HH
(e.g. "+09")Asia/Tokyo
)America/Argentina/Buenos_Aires
)time_format_fallbacks
() (optional): uses the specified time format as a fallback in the specified order.time_format_fallbacks
. This options is enabled when time_type
is mixed
.nil
unixtime
at first, if it fails, then it is parsed as %iso8601
secondary. Note that time_format_fallbacks
is the last resort to parse mixed timestamp format. There is a performance penalty (Typically, N fallbacks are specified in time_format_fallbacks
and if the last specified format is used as a fallback, N times slower in the worst case).