Skip to content

Regex Log Tester · Logs

Test your log regex against real lines.

Paste a regular expression and sample Loki, Promtail or Fluent Bit log lines to test regex against sample log lines live — every match, capture group and named group lights up instantly in your browser, free and with no signup.

Runs in your browser No signup Free & open Updated Jul 29, 2026

Regex Log Tester playground

(sample)

JavaScript regular expression syntax. Matching updates as you type.

Flags
sample.log

Tip: press Esc to release focus.

matches
highlighted
Matches

Enter a pattern above to see live matches, capture groups and named groups here.

The Gap

Get the pattern right before it ships.

A log-parsing regex usually fails quietly. You ship a regexp stage or a pattern parser, deploy it, and only later notice a field never populated or a whole stream of lines slipped through. The feedback loop runs through a pipeline and a dashboard instead of through the pattern in front of you.

This tester closes that loop. Paste the exact lines you’re parsing, watch the matches and named groups resolve as you edit, and fix the expression in seconds — before it reaches a config file. It’s the quick scratchpad that the big regex playgrounds aren’t: line-oriented, tuned for log parsing, and safe for sensitive logs by default because everything runs client-side and your data never leaves the page.

That matters double for AI-suggested patterns: a model writes a regex that looks right and quietly matches the wrong lines. Here the real JavaScript regex engine runs against your actual log sample, so the matches you see are ground truth, not a plausible guess.

New to capture groups? Jump to the syntax notes or try the live playground above.

The Pipeline

How it works.

Five deterministic steps run on every edit — all inside your browser tab, every time.

  1. Compile the pattern.

    Your expression and flags are compiled with the browser's native regex engine — the same one your front-end code already runs on.

  2. Split the log lines.

    The sample block is split into individual lines so each one is tested on its own, exactly as a per-line log agent would apply it.

  3. Match every line.

    Each line is scanned for matches. With the global flag, every match on a line is found, not just the first.

  4. Extract the groups.

    For each match the tester pulls out numbered capture groups and any named groups, ready to read as fields.

  5. Render live.

    Matches are highlighted in place and groups are listed beneath, updating as you edit — all without leaving the page.

Syntax

A pattern, your lines, the flags.

The tester takes two inputs — a regular expression and a block of log lines — and applies the standard JavaScript flags. If you have written a parser for any log agent, this will feel familiar.

The pattern

Name the fields you want to extract with (?<name>…) capture groups. The tester lists each named group it captured, the same way Loki’s pattern / regexp parsers and Promtail’s regex stage turn matches into labels.

pattern.re
^(?<ts>\d{4}-\d{2}-\d{2}T\S+)\s+
(?<level>INFO|WARN|ERROR)\s+
(?<logger>[\w.]+)\s+-\s+
(?<msg>.*)$

The log lines

Paste the real lines you’re parsing — one per row. Each line is tested on its own, so a match or miss on one line never affects the next. Drop in a representative mix of INFO, WARN and ERROR samples to confirm the pattern generalises.

sample.log
2026-06-08T09:14:02Z INFO  app.checkout - order 4821 placed
2026-06-08T09:14:05Z WARN  app.payment  - retrying charge for order 4821
2026-06-08T09:14:07Z ERROR app.payment  - charge failed: gateway timeout
2026-06-08T09:14:09Z INFO  app.checkout - order 4821 cancelled

The flags

Flags change how the engine reads your pattern. For per-line log parsing, the two you’ll reach for most are m (so anchors hug each line) and i (case-insensitive levels).

flags.txt
g   global    find every match on a line, not just the first
i   ignore    case-insensitive matching (ERROR == error)
m   multiline ^ and $ anchor to each line, not the whole input
s   dotAll    . also matches newline characters
u   unicode   treat the pattern as a sequence of code points

A Note on Flavors

This tester uses your browser’s JavaScript (ECMAScript) regex engine. Many log agents — Loki, Promtail and the Grafana Agent — are written in Go and use the RE2 engine, which deliberately omits backreferences and lookaround for guaranteed-linear performance. PCRE-based tools differ again. The core syntax — classes, anchors, quantifiers and named groups — is shared, so this is an excellent first pass; just confirm anything exotic in your target engine before you ship it.

FAQ

Questions, answered.

Tap a question to expand the answer.

It's a free, browser-based tool for testing a regular expression against real log lines. You paste a pattern and a block of sample logs, and it highlights every match, lists each capture group, and names any named groups — line by line. It's built specifically for the log-parsing patterns you write for Loki, Promtail, Grafana Agent, Fluent Bit, Logstash and friends.

No. The tester runs 100% client-side using your browser's own regex engine. Your pattern and log lines are evaluated in the page — nothing is uploaded to a server, and there's no account or signup. You can safely paste internal or sensitive log samples.

It uses the JavaScript (ECMAScript) regular-expression engine built into your browser, so syntax like \d, character classes, anchors, alternation, named groups ((?<name>…)) and flags such as g, i, m and s all behave exactly as they do in JavaScript. The flavor differs in places from RE2 (used by Go-based log agents like Loki and Promtail) and PCRE, so always confirm a pattern in your target engine before shipping it.

Use named capture groups. Wrap each field you want to extract in (?<name>…) — for example (?<ts>\S+) (?<level>\w+) (?<msg>.*). The tester lists every named group it captured per matching line, which mirrors how Loki's pattern/regexp parsers and Promtail's regex stage turn matches into labels.

By default the dot (.) does not match newlines, and ^/$ match the start and end of the whole input rather than each line. Add the m flag so ^ and $ anchor to each line, and the s (dotAll) flag if you need . to span newlines. The tester evaluates each log line independently, which matches how most log agents apply a regex per line.

The tester runs your pattern with a guard so a pathological expression won't freeze the tab, and it surfaces an error instead of hanging. It still pays to avoid nested quantifiers on overlapping classes (the classic (a+)+ shape) — those can be slow in any engine, not just in the browser.

Paste your sample log lines and your regular expression into the input fields, then watch matches highlight live as you type. The tester applies the pattern to each line independently, so you see at a glance which lines match and which do not — without running a pipeline or deploying a config change. Because everything runs in your browser, you can test against real or redacted log samples with no upload required.

For most log-parsing work, start with m (multiline) so ^ and $ anchor to each line rather than the whole input, and g (global) to find every match rather than stopping at the first. The tester adds g automatically so all-matches mode is always on. Add i (case-insensitive) when log levels or HTTP methods vary in case, and s (dotAll) only when a match needs to span a newline within a single log entry.

Build the pattern field by field — IP address, timestamp, request method, path, status code, response size — and use named groups such as (?<ip>\S+) and (?<status>\d{3}) to label each extracted field. Paste several real access log lines into the tester to verify the pattern matches every variation before you place it in a Promtail pipeline stage or a Logstash grok filter. The tester shows exactly which groups matched on each line, so gaps are immediately visible.

A regex log tester works with raw regular expressions — including named capture groups — directly against log lines. A grok tester uses named %{PATTERN:field} macros that compile down to regex for tools like Logstash or the Elastic stack. If you want full control over the underlying pattern, or if your log agent (such as Loki or Promtail) takes a raw regexp stage, a regex log tester is the more direct tool. Grok and raw regex are complementary: you can prototype a named-group regex here and then translate the captured fields into a grok-compatible pipeline.

New to this? Read our guide on Linux for DevOps.

More free, private DevOps tools.

The Regex Log Tester is one tool in OpsCanopy — a growing canopy of browser-based validators, converters and testers that never touch a server.

New to Linux?  Read the Linux guide →

29 free tools, every one offline-capable — opscanopy.com works with no signup and nothing uploaded.

Parsing Loki logs? Pair this with AlertLint, the promtool-style unit tester for Loki alert rules. Once your pattern is solid, feed the captured fields into the LogQL ↔ PromQL Helper, and check your regex-driven relabel rules with the Prometheus Relabel Tester — or browse the full tools directory.

Not affiliated with or endorsed by Grafana Labs. Loki, Promtail and Grafana are trademarks of Raintank, Inc.