Grok patterns are supported in the ingest node and the Logstash grok filter. See for more information on the syntax for a grok pattern.
The Elastic Stack ships with more than 120 reusable grok patterns. See Ingest node grok patterns and for the complete list of patterns.
Because ingest node and Logstash share the same grok implementation and pattern libraries, any grok pattern that you create in the Grok Debugger will work in ingest node and Logstash.
This example walks you through using the Grok Debugger. This tool is automatically enabled in Kibana.
If you’re using Elastic Stack security features, you must have the permission to use the Grok Debugger.
- Open the menu, go to Dev Tools, then click Grok Debugger.
In Grok Pattern, enter the grok pattern that you want to apply to the data.
Click Simulate.
You’ll see the simulated event that results from applying the grok pattern.
If the default grok pattern dictionary doesn’t contain the patterns you need, you can define, test, and debug custom patterns using the Grok Debugger.
Custom patterns that you enter in the Grok Debugger are not saved. Custom patterns are only available for the current debugging session and have no side effects.
Follow this example to define a custom pattern.
In Sample Data, enter the following sample message:
-
Notice that the grok pattern references custom patterns called and .
Click Simulate.
You’ll see the simulated output event that results from applying the grok pattern that contains the custom pattern:
If an error occurs, you can continue iterating over the custom pattern until the output matches the event that you expect.