← All text tools

Grok Pattern Tester

Test a grok pattern against sample log lines, expand named patterns such as IP and TIMESTAMP_ISO8601 and see every field it extracts with its type.

  • Free
  • No sign-up
  • Works on any device

About Grok Pattern Tester

Grok turns unstructured log lines into fields with named patterns, so %{IP:client} stands for a long address expression and gives the matched text the field name client. This tester expands the standard Logstash patterns, including IP, WORD, NUMBER, URIPATHPARAM, HTTPDATE, TIMESTAMP_ISO8601, LOGLEVEL and COMBINEDAPACHELOG, and runs the result on your sample lines. You can add your own named patterns, convert a field to int or float with %{NUMBER:bytes:int}, and see the full regular expression that was built. A plain regex tester cannot do that expansion.

How to use Grok Pattern Tester

  1. Write or paste a grok pattern such as the sample with IP, WORD and NUMBER.
  2. Paste a few real log lines, one per line, and add custom patterns if you use any.
  3. Read the matched fields and types, and fix any line that shows no match.

Why use this tool?

Also known as

Frequently asked questions

Does it behave exactly like Logstash?

Very close, but the patterns are ported to JavaScript regular expressions. Atomic groups become normal groups and Oniguruma-only syntax is not available, so a rare pattern can match slightly differently from Logstash.

How do I turn a number into an integer or a float?

Add the type after the field name, for example %{NUMBER:bytes:int} or %{NUMBER:duration:float}. The table then shows the converted value and its type.

Why does my pattern fail on lines that look right?

Spaces must match exactly, and unanchored grok finds the pattern anywhere in the line. Replace single spaces with %{SPACE} or %{GREEDYDATA} where the format varies, and tick the whole-line option to check the full line.

Is Grok Pattern Tester free?

Yes. Grok Pattern Tester on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.