Grok
Synopsis
Extracts structured fields from unstructured log messages using predefined patterns.
Schema
- grok:
field: <ident>
patterns: <string[]>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
pattern_definitions: <map>
tag: <string>
trace_match: <boolean>
Configuration
The following fields are used to define the processor:
| Field | Required | Default | Description |
|---|---|---|---|
field | Y | - | Text field to extract patterns from |
patterns | Y | - | List of patterns to try matching (first match wins). See below |
description | N | - | Documentation note |
if | N | - | Conditional expression |
ignore_failure | N | false | Skip pattern match failures |
ignore_missing | N | false | Skip if input field missing |
on_failure | N | - | Error handling processors |
on_success | N | - | Success handling processors |
pattern_definitions | N | - | Custom pattern definitions |
tag | N | - | Identifier for logging |
trace_match | N | false | Track which pattern matched |