What is logfmt Parser?
logfmt Parser converts structured log lines in the logfmt format into JSON. logfmt is a widely used logging format where each line contains space-separated key=value pairs, popularized by Heroku and used by many observability tools including Grafana Loki, Prometheus, and structured logging libraries.
When debugging production issues, you often need to pull apart logfmt lines to find specific fields like request IDs, durations, error messages, or user identifiers. This tool parses the lines into structured JSON so you can read and search the data clearly.
How to Use logfmt Parser
Paste one or more logfmt log lines. Each line is parsed into a JSON object where logfmt keys become JSON keys and values are converted to their appropriate types. Multiple lines produce a JSON array of objects.
The parser handles quoted values (for strings containing spaces), escaped characters, and valueless keys (which become boolean true in JSON). Lines with parse errors show per-line diagnostics so you know exactly what went wrong.
Common Use Cases
- Production debugging: Parse logfmt entries from production logs to extract request IDs, error details, and timing information.
- Log analysis: Convert batches of logfmt lines to JSON for processing with jq, importing into analysis tools, or querying with JSON Path.
- Alerting investigation: Parse alert context from observability platforms that use logfmt as their native log format.
- Metric correlation: Extract timing and count fields from structured logs to correlate with metrics dashboards.
- Incident response: Quickly parse and search through logfmt log snippets shared in incident channels.