Test a Grok pattern

  • POST also GET /_text_structure/test_grok_pattern
Auth

Test a Grok pattern on one or more lines of text. The API indicates whether the lines match the pattern together with the offsets and lengths of the matched substrings.

Read the reference documentation

Query parameters

ecs_compatibility string · default: disabled

The mode of compatibility with ECS compliant Grok patterns. Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. Valid values are disabled and v1.

Request body

grok_pattern string required

The Grok pattern to run on the text.

text string[] required

The lines of text to run the Grok pattern on.

Response

application/json
matches object[] required
matched boolean required
fields map string to object