Docs
Search…
Regex Parser
Regex parser parses a log field's value with a Regular Expression.

Example

Suppose we have following log event
Input
1
{
2
"_message": "5.86.210.12 - zieme4647 5667 [19/06/2019:17:20:49 -0400] \"GET /embrace/supply-chains/dynamic/vertical\" 201 20574"
3
}
Copied!
To apply regex parser on _message field, fill out function form. In this example, the regex pattern we want to use is:
1
(?P<host>[\w\.]+) - (?P<user>[\w]+) .* \[(?P<timestamp>.*)\]
Copied!
Output event will look like following:
Output
1
{
2
"_message": "5.86.210.12 - zieme4647 5667 [19/06/2019:17:20:49 -0400] \\\"GET /embrace/supply-chains/dynamic/vertical\\\" 201 20574",
3
"host": "5.86.210.12",
4
"timestamp": "19/06/2019:17:20:49 -0400",
5
"user": "zieme4647"
6
}
Copied!
Copy link
Contents
Example