Docker Container Log Regex Generator
Generate named capture groups for Docker-style container logs locally in the browser.
2026-04-27T10:22:31.123Z api-container | Started worker process
Generate named capture groups for Docker-style container logs locally in the browser.
此工具在你的浏览器本地运行。你的输入不会被上传。
Copy the generated result or open the full tool to adjust inputs locally.
2026-04-27T10:22:31.123Z api-container | Started worker process
JavaScript regex
/^(?<timestamp>\d{4}-\d{2}-\d{2}T[^\s]+Z?)\s+(?<container>[^|\s]+)\s+\|\s+(?<message>[^\r\n]*)$/m
Python regex
r"^(?P<timestamp>\\d{4}-\\d{2}-\\d{2}T[^\\s]+Z?)\\s+(?P<container>[^|\\s]+)\\s+\\|\\s+(?P<message>[^\\r\\n]*)$"
Field table
| Field | Capture group |
| --- | --- |
| timestamp | `timestamp` |
| container | `container` |
| message | `message` |
Preview
Line 1: matched (timestamp=2026-04-27T10:22:31.123Z, container=api-container, message=Started worker process)
Python snippet
import re
pattern = re.compile(r"^(?P<timestamp>\\d{4}-\\d{2}-\\d{2}T[^\\s]+Z?)\\s+(?P<container>[^|\\s]+)\\s+\\|\\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+(?<container>[^|\s]+)\s+\|\s+(?<message>[^\r\n]*)$/m;
const match = line.match(pattern);
const fields = match?.groups ?? {};Generate named capture groups for Docker-style container logs locally in the browser.
2026-04-27T10:22:31.123Z api-container | Started worker process
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.