grok

grok #

CategoryScope
Recordrecord

The “grok” pipeline processor: regex-based field.

Configuration #

FieldTypeDefaultDescription
fieldstringSource field to read from.
patternsliststringExtraction patterns tried in order; the first match wins.
pattern_definitionsmap (string to string)custom %{NAME} -> body, overrides built-ins/library
target_fieldstringDestination field to write the result to.
overwrite_keysboolOverwrite fields that already exist in the record.
ignore_missingboolDo not fail when the source field is missing.
ignore_failureboolDo not fail the record when processing errors; the record passes through unchanged.
tagstringTag appended to the record when processing fails.

Example #

processor:
  - for_each:
      processor:
        - grok:
            field: message
            patterns:
              - "%{IPORHOST:client} %{WORD:verb} %{HTTPDATE:ts}"
            pattern_definitions:
              CUSTOM_CODE: "%{NUMBER:code:int}"
Edit Edit this page