Grok Pattern Tester
Build and test Grok patterns against sample lines.
- Your draft is kept in this tab's session storage and cleared when the tab closes.
Draft kept in this tab
Your draft is kept in this tab's session storage and cleared when the tab closes. - Processing happens in this page. No application server receives your input.
Runs in your browser
Processing happens in this page. No application server receives your input.
Sample log lines
Sample line matches
- Targets
- Logstash core patterns (~120), JavaScript RegExp engine
- Captures
- 0
- Expanded length
- 0
- Lines matched
- 0 of 0
- Time
- 0 ms
| Line | Matched |
|---|---|
| Enter a Grok pattern and sample lines to see which lines match. | |
Custom patterns (NAME pattern per line)
Expanded regular expression
Defined captures
| Name | From pattern | Type |
|---|---|---|
| Enter a Grok pattern to see its named captures. | ||
Built-in and custom pattern library
| Pattern | Expansion | Insert |
|---|---|---|
| The pattern library is loading. | ||
Logstash and Ingest Pipeline Grok Reference
Expands %{SYNTAX:semantic:type} references against the core Logstash pattern dictionary on the main thread and compiles the expanded expression inside regex.worker.ts behind a 2-second termination guard.
Duplicate Capture Uniquification
Logstash allows repeating the same semantic capture name in one pattern (for example, %{WORD:tag} .* %{WORD:tag}). Because JavaScript rejects duplicate group names at compile time, the expander emits unique group identifiers (tag, tag__2) and collapses captured values back into a single tag column in order.
Limits and Scope
Oniguruma syntax is not supported, and the difference matters: Logstash compiles Grok with Oniguruma, this compiles it with JavaScript RegExp, and patterns using \h, possessive quantifiers, \K, or (?<name>...) with duplicate names behave differently or not at all. The tool names the construct when it finds one rather than matching wrongly. The library is the ~120 core patterns Logstash ships, not the full grok-patterns tree with its firewalls, haproxy, and java sets. Type coercion (:int, :float) is shown as a column annotation and not applied: every captured value stays a string. Matching stops at two seconds or 10,000 matches, inherited from T19. It does not run a pipeline: there is no date, mutate, or dissect after the match.
Diagnostic Rules
| Rule | Severity | Fires when |
|---|---|---|
GROK/shadowed-pattern | info | A custom pattern definition overrides a built-in library pattern of the same name |
GROK/invalid-custom-pattern | warning | A custom pattern line does not follow the NAME regex format |
GROK/oniguruma-hex-escape | warning | Pattern uses Oniguruma \h or \H hex escape, which is unsupported in JavaScript |
GROK/oniguruma-keep | warning | Pattern uses Oniguruma \K match-start reset, which is unsupported in JavaScript |
GROK/oniguruma-possessive | warning | Pattern uses Oniguruma possessive quantifiers (*+, ++, ?+) |
Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.