The regexp parser plugin parses logs by given regexp pattern. The regexp must have at least one named capture (?<NAME>PATTERN). If the regexp has a capture named time, this is configurable via time_key parameter, it is used as the time of the event. You can specify the time format using the time_format parameter.
Copy <parse>
@type regexp
expression /.../
</parse> See Parse Section Configurations for common parameters.
Specifies the regular expression for matching logs. Regular expression also supports i and m suffix.
Ignores case in matching.
Build regular expression as a multiline mode. . matches the newline. See Ruby's Regexparrow-up-right .
Specifies both i and m.
expression is the string type before 1.2.0.
Ignores case in matching. Use i option with expression.
Deprecated since 1.2.0. Use expression /pattern/i instead.
Builds regular expression in multiline mode. . matches the newline. See Ruby's Regexparrow-up-right . Use m option with expression.
Deprecated since 1.2.0. Use expression /pattern/m instead.
With this configuration:
This incoming event:
is parsed as:
How to debug my regexp pattern?
fluentd-ui's in_tail editor helps your regexp testing. Another way, Fluentulararrow-up-right is a great website to test your regexp for Fluentd configuration.
NOTE: You may hit Application Error at Fluentular due to heroku's free plan limitationarrow-up-right . Retry a few hours later or use fluentd-ui instead.
If this article is incorrect or outdated, or omits critical information, please let us knowarrow-up-right . Fluentdarrow-up-right is an open-source project under Cloud Native Computing Foundation (CNCF)arrow-up-right . All components are available under the Apache 2 License.