nginx
The nginx
parser plugin parses default nginx logs.
Parameters
keep_time_key
If you want to keep time field in the record, set true
. Default is false
.
types
Although every parsed field has type string
by default, you can specify other types. This is useful when filtering particular fields numerically or storing data with sensible type information.
The syntax is
e.g.,
As demonstrated above, "," is used to delimit field-type pairs while ":" is used to separate a field name with its intended type.
Unspecified fields are parsed at the default string type.
The list of supported types are shown below:
string
bool
integer ("int" would NOT work!)
float
time
array
For the time
and array
types, there is an optional third field after the type name. For the "time" type, you can specify a time format like you would in time_format
.
For the "array" type, the third field specifies the delimiter (the default is ","). For example, if a field called "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"].
Regexp patterns
This is regexp and time format patterns of this plugin:
remote
, user
, method
, path
, code
, size
, referer
and agent
are included in the event record. time
is used for the event time.
Example
This incoming event is parsed as:
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