Zero Signup ToolsFree browser tools

Developer Tools

Grok Pattern Tester

Test a grok pattern against a sample log line in your browser. Extract named fields, see the compiled regex, with built-in Logstash patterns. No signup.

Grok pattern tester

188 chars
90 chars
Samples

Write a grok pattern using %{SYNTAX:field} references and match it against a sample line. The pattern is matched anywhere in the line, the same default the Logstash grok filter uses. Add ^ and $ yourself for a strict full-line match.

Extracted fields (9)

FieldValueType
clientip192.168.1.42string
ident-string
authfrankstring
timestamp10/Oct/2026:13:55:36 +0000string
verbGETstring
request/images/logo.pngstring
httpversion1.1string
response200(was "200")number
bytes2326(was "2326")number

Matched text

192.168.1.42 - frank [10/Oct/2026:13:55:36 +0000] "GET /images/logo.png HTTP/1.1" 200 2326

Compiled regular expression

(?<g0>(?:(?:(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,5}(?::[0-9A-Fa-f]{1,4}){1,2}|(?:[0-9A-Fa-f]{1,4}:){1,4}(?::[0-9A-Fa-f]{1,4}){1,3}|(?:[0-9A-Fa-f]{1,4}:){1,3}(?::[0-9A-Fa-f]{1,4}){1,4}|(?:[0-9A-Fa-f]{1,4}:){1,2}(?::[0-9A-Fa-f]{1,4}){1,5}|[0-9A-Fa-f]{1,4}:(?::[0-9A-Fa-f]{1,4}){1,6}|:(?::[0-9A-Fa-f]{1,4}){1,7}|::))|(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))))|(?:\b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(?:\.?|\b)))) (?<g1>(?:[a-zA-Z0-9._-]+)) (?<g2>(?:[a-zA-Z0-9._-]+)) \[(?<g3>(?:(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]))/(?:\b(?:[Jj]an(?:uary|uar)?|[Ff]eb(?:ruary|ruar)?|[Mm](?:a|ä)?r(?:ch|z)?|[Aa]pr(?:il)?|[Mm]a(?:y|i)?|[Jj]un(?:e|i)?|[Jj]ul(?:y|i)?|[Aa]ug(?:ust)?|[Ss]ep(?:tember)?|[Oo](?:c|k)?t(?:ober)?|[Nn]ov(?:ember)?|[Dd]e(?:c|z)(?:ember)?)\b)/(?:(?:\d\d){1,2}):(?:(?:[^0-9]?)(?:(?:2[0123]|[01]?[0-9])):(?:(?:[0-5][0-9]))(?::(?:(?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?)))(?:[^0-9]?)) (?:(?:[+-]?(?:[0-9]+))))\] "(?<g4>\b\w+\b) (?<g5>(?:(?:/[A-Za-z0-9$.+!*'(){},~:;=@#%&_\-]*)+)(?:(?:\?[A-Za-z0-9$.+!*'|(){},~@#%&/=:;_?\-\[\]<>]*))?) HTTP/(?<g6>(?:(?:(?:[+-]?(?:[0-9]+(?:\.[0-9]+)?)|\.[0-9]+))))" (?<g7>(?:(?:(?:[+-]?(?:[0-9]+(?:\.[0-9]+)?)|\.[0-9]+)))) (?:(?<g8>(?:(?:(?:[+-]?(?:[0-9]+(?:\.[0-9]+)?)|\.[0-9]+))))|-)

Every %{...} reference is expanded into this single expression. Named field captures become named groups; references without a field name become non-capturing groups.

Common patterns in the library

A practical subset of the Logstash core grok patterns is built in. These are the names you can use inside %{...}. Each resolves to a regular expression, and many reference others.

IPIPV4HOSTNAMEWORDNOTSPACENUMBERINTPOSINTDATAGREEDYDATAQSUUIDLOGLEVELTIMESTAMP_ISO8601HTTPDATESYSLOGTIMESTAMPURIPATHPARAMURI

How to use

  1. Paste or type a grok pattern into the first box, using %{SYNTAX:field} references for the parts you want to capture, or load one of the built-in samples.
  2. Paste a representative log line into the second box. The pattern is matched anywhere in the line, the same default the Logstash grok filter uses.
  3. Read the extracted fields table: each captured field is listed with its value, and an int or float hint shows the value coerced to a number.
  4. Use the field name syntax %{SYNTAX:name} to capture a value and %{SYNTAX} without a name to match without capturing, then add :int or :float to coerce numbers.
  5. Copy the captured fields as JSON, or copy the compiled regular expression to reuse the same matching logic in code or another regex tool.
  6. If there is no match, compare the compiled expression shown below against your line: literal brackets, dots, and slashes must appear in both. The pattern and line stay in your browser.

About this tool

Grok Pattern Tester is a browser-based grok debugger for the pattern language that Logstash, Elasticsearch ingest pipelines, Filebeat, and similar log shippers use to turn an unstructured log line into structured, named fields. A grok pattern is built from references written as %{SYNTAX}, %{SYNTAX:field}, or %{SYNTAX:field:int}, mixed with ordinary text and regular-expression syntax. Each SYNTAX name, for example IP, WORD, NUMBER, TIMESTAMP_ISO8601, or LOGLEVEL, is itself defined as a regular expression that may reference other patterns, and the grok engine resolves those references until the whole thing becomes one regular expression that it matches against the line. This tool reproduces exactly that process locally. It ships a practical subset of the standard Logstash core patterns, the ones that appear in almost every real-world grok expression, and a compiler that expands every %{...} reference recursively into a native JavaScript regular expression using named capture groups. You paste a grok pattern and a sample log line, and it shows three things: the fields the pattern captured, with each value and whether the int or float hint coerced it to a number; the literal text the pattern matched; and the full compiled regular expression, which you can copy and reuse anywhere a plain regex is accepted. The matcher is unanchored by default, the same behavior as the Logstash grok filter, so a pattern matches if it appears anywhere in the line; you add ^ and $ yourself when you need a strict full-line match. Errors are explained rather than swallowed: a reference to an unknown pattern name names the missing pattern, a self-referential definition is caught as a cycle instead of hanging the browser, and a pattern that compiles but produces an invalid regular expression (usually an unbalanced bracket in your own literal text) is reported with the compiled output shown so you can find the problem. Built-in samples cover an NGINX or Apache combined access log, a syslog line, an application log with a level and thread, and a simple key-equals-value line, so you can see a working pattern immediately. This is a tester and an explainer, not a log pipeline: it does not read files, run a Logstash configuration, or ship logs anywhere. The pattern and the log line you enter are matched entirely in your browser with the native RegExp engine and are never uploaded.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools