# Test a Grok pattern **POST /_text_structure/test_grok_pattern** **All methods and paths for this operation:**
GET /_text_structure/test_grok_pattern
POST /_text_structure/test_grok_pattern
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. [External documentation](https://www.elastic.co/docs/explore-analyze/scripting/grok) ## Servers - http://api.example.com: http://api.example.com () ## Authentication methods - Api key auth - Basic auth - Bearer auth ## Parameters ### Query parameters - **ecs_compatibility** (string) 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`. ### Body: application/json (object) - **grok_pattern** (string) The Grok pattern to run on the text. - **text** (array[string]) The lines of text to run the Grok pattern on. ## Responses ### 200 #### Body: application/json (object) - **matches** (array[object]) [Powered by Bump.sh](https://bump.sh)