Grok Pattern Builder & Debugger
Frequently Asked Questions
What is Grok and what is it used for?
How do I use the Grok Pattern Builder?
What Grok patterns are available?
Where are Grok patterns used?
What is the difference between Grok and regular expressions?
Can Grok be used with Fluentd?
Grok Pattern Examples
Three practical examples showing how Grok transforms real logs into structured data.
Example 1 β Apache/Nginx Log
The most common use case: parsing a web server access log line.
Input (raw log)
192.168.1.1 - - [10/Jun/2026:14:30:22 +0000] "GET /index.html HTTP/1.1" 200 1234
Grok Pattern
%{IP:client} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:method} %{URIPATHPARAM:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:status} %{NUMBER:bytes} Output JSON
{ "client": "192.168.1.1",
"ident": "-",
"auth": "-",
"timestamp": "10/Jun/2026:14:30:22 +0000",
"method": "GET",
"request": "/index.html",
"httpversion": "1.1",
"status": "200",
"bytes": "1234"
} Example 2 β Linux Syslog
Parsing an SSH authentication message from syslog.
Input (raw log)
Jun 10 14:30:22 webserver sshd[12345]: Failed password for root from 192.168.1.1 port 22 ssh2
Grok Pattern
%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{DATA:program}\[%{NUMBER:pid}\]: %{GREEDYDATA:message} Output JSON
{ "timestamp": "Jun 10 14:30:22",
"hostname": "webserver",
"program": "sshd",
"pid": "12345",
"message": "Failed password for root from 192.168.1.1 port 22 ssh2"
} Example 3 β Java Application Log
Parsing Java application logs with levels, threads, and class names.
Input (raw log)
2026-06-10 14:30:22,456 ERROR [io.netty.handler] (default I/O worker) - Connection reset by peer
Grok Pattern
%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} \[%{DATA:logger}\] \(%{DATA:thread}\) - %{GREEDYDATA:message} Output JSON
{ "timestamp": "2026-06-10 14:30:22,456",
"level": "ERROR",
"logger": "io.netty.handler",
"thread": "default I/O worker",
"message": "Connection reset by peer"
} Related Tools
SSH Config Generator
Generate ~/.ssh/config for multiple servers with Jump Host (ProxyJump)
K8s to Terraform Converter
Convert Kubernetes YAML manifests to Terraform resources.
Downtime Calculator
Calculate availability percentage based on downtime
Regex Tester
Test regular expressions in real time with predefined patterns for IP, email and more