Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions _ingest-pipelines/processors/grok.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ For a list of available predefined patterns, see [Grok patterns](https://github.

The `grok` processor is built on the [Oniguruma regular expression library](https://github.com/kkos/oniguruma/blob/master/doc/RE) and supports all the patterns from that library. You can use the [Grok Debugger](https://grokdebugger.com/) tool to test and debug your grok expressions.

Note that patterns are *not anchored* - for performance and reliability it is advisable to include at least a start-of-line anchor (`^`)

## Syntax

The following is the basic syntax for the `grok` processor:
Expand Down Expand Up @@ -69,7 +71,7 @@ PUT _ingest/pipeline/log_line
{
"grok": {
"field": "message",
"patterns": ["%{IPORHOST:clientip} %{HTTPDATE:timestamp} %{NUMBER:response_status:int}"]
"patterns": ["^%{IPORHOST:clientip} %{HTTPDATE:timestamp} %{NUMBER:response_status:int}"]
}
}
]
Expand Down Expand Up @@ -158,7 +160,7 @@ PUT _ingest/pipeline/log_line
{
"grok": {
"field": "message",
"patterns": ["The issue number %{NUMBER:issue_number} is %{STATUS:status}"],
"patterns": ["^The issue number %{NUMBER:issue_number} is %{STATUS:status}"],
"pattern_definitions" : {
"NUMBER" : "\\d{3,4}",
"STATUS" : "open|closed"
Expand All @@ -182,7 +184,7 @@ PUT _ingest/pipeline/log_line
{
"grok": {
"field": "message",
"patterns": ["%{HTTPDATE:timestamp} %{IPORHOST:clientip}", "%{IPORHOST:clientip} %{HTTPDATE:timestamp} %{NUMBER:response_status:int}"],
"patterns": ["^%{HTTPDATE:timestamp} %{IPORHOST:clientip}", "%{IPORHOST:clientip} %{HTTPDATE:timestamp} %{NUMBER:response_status:int}"],
"trace_match": true
}
}
Expand Down