Kubernetes Pod Log Regex Generator
Generate named capture groups for Kubernetes-like pod logs locally in the browser.
2026-04-27T10:25:00Z prod/api-7d9f4 api Failed readiness probe
Generate named capture groups for Kubernetes-like pod logs locally in the browser.
This tool runs locally in your browser. Your input is not uploaded.
Copy the generated result or open the full tool to adjust inputs locally.
2026-04-27T10:25:00Z prod/api-7d9f4 api Failed readiness probe
JavaScript regex
/^(?<timestamp>\d{4}-\d{2}-\d{2}T[^\s]+Z?)\s+(?<namespace>[\w.-]+)\/(?<pod>[\w.-]+)\s+(?<container>[\w.-]+)\s+(?<message>[^\r\n]*)$/m
Python regex
r"^(?P<timestamp>\\d{4}-\\d{2}-\\d{2}T[^\\s]+Z?)\\s+(?P<namespace>[\\w.-]+)\\/(?P<pod>[\\w.-]+)\\s+(?P<container>[\\w.-]+)\\s+(?P<message>[^\\r\\n]*)$"
Field table
| Field | Capture group |
| --- | --- |
| timestamp | `timestamp` |
| namespace | `namespace` |
| pod | `pod` |
| container | `container` |
| message | `message` |
Preview
Line 1: matched (timestamp=2026-04-27T10:25:00Z, namespace=prod, pod=api-7d9f4, container=api, message=Failed readiness probe)
Python snippet
import re
pattern = re.compile(r"^(?P<timestamp>\\d{4}-\\d{2}-\\d{2}T[^\\s]+Z?)\\s+(?P<namespace>[\\w.-]+)\\/(?P<pod>[\\w.-]+)\\s+(?P<container>[\\w.-]+)\\s+(?P<message>[^\\r\\n]*)$")
match = pattern.search(line)
if match:
fields = match.groupdict()
JavaScript snippet
const pattern = /^(?<timestamp>\d{4}-\d{2}-\d{2}T[^\s]+Z?)\s+(?<namespace>[\w.-]+)\\/(?<pod>[\w.-]+)\s+(?<container>[\w.-]+)\s+(?<message>[^\r\n]*)$/m;
const match = line.match(pattern);
const fields = match?.groups ?? {};Generate named capture groups for Kubernetes-like pod logs locally in the browser.
2026-04-27T10:25:00Z prod/api-7d9f4 api Failed readiness probe
No. It generates a practical starter for common formats and shows warnings when manual adjustment is likely.
No. Generation and preview run locally in the browser.
Named groups make downstream parsing clearer because each extracted value is labeled by field name.