Log to Metrics
Paste structured log lines — NDJSON, logfmt or CSV — and get the RED metrics back: how many requests per endpoint, what share of traffic, the throughput rate over the log's own time span, the error rate, and exact p50/p95/p99 latency. Group by any field or combination of fields, rank by the slowest, and export as a table, JSON, CSV or Prometheus exposition. Runs entirely in your browser, no upload, no sign-up.
Logs into RED metrics
Paste structured log lines and aggregate them into the numbers you usually need for an incident review or a dashboard seed: request counts, traffic share, rate over the log's own time span, error counts, error percentage, and exact latency percentiles. The tool reads NDJSON (one JSON object per line), logfmt key=value records, and CSV/TSV blocks with a header row. It runs locally in the browser; nothing is uploaded.
Worked example
Input NDJSON:
{"ts":"2024-05-06T07:00:00Z","route":"/api/users","status":200,"duration_ms":37}
{"ts":"2024-05-06T07:00:20Z","route":"/api/users","status":500,"duration_ms":412}
{"ts":"2024-05-06T07:00:40Z","route":"/api/users","status":200,"duration_ms":58}
{"ts":"2024-05-06T07:01:00Z","route":"/api/orders","status":200,"duration_ms":120}
Set Group by fields to route, Numeric field to duration_ms, and Error field to status. The output shows one row per route with count, percent, a rate column, errors, error_%, min, avg, p50, p95, p99, max, and sum. Sort by p_top when you want the slowest endpoints first; sort by errors when you want the noisiest groups first.
Options that matter
- Input format can auto-detect JSON/NDJSON, logfmt, and CSV. Set it explicitly when a sample is mixed or ambiguous.
- Group by fields accepts up to five comma-separated fields. Nested JSON is flattened to dotted paths, so
http.statusworks. - Numeric field is optional. When present, plain numbers are used as-is and durations such as
250ms,1.5s,10us, or2mare normalised to milliseconds. - Percentiles are exact over the pasted batch. Choose
linearinterpolation for numpy/R-style values, ornearestwhen you want a percentile to be an observed value. - Timestamp field drives the rate column. Leave it blank to auto-detect common timestamp names, or set it to
nonefor count-only logs. - Error field plus Values that count as errors handles HTTP classes (
5*), numeric comparisons (>=500), and severity strings (error,fatal,panic). - Output format can be a Markdown-style table, JSON report, CSV, or Prometheus text exposition.
Limits and edge cases
- Maximum input is 2,000,000 characters, 200,000 lines, and 50,000 distinct groups per run.
- This is a one-shot batch aggregator. It does not tail a file, store state, or build time-bucketed series.
- Missing group fields are labelled
(missing)rather than dropped. - Missing or non-numeric values in the numeric field are counted in the summary and not treated as zero.
- If Roll the remainder into an (other) row is enabled, that row recomputes percentiles from the merged raw values; it does not average the visible rows.
FAQ
What log formats can I paste?
Use NDJSON with one JSON object per line, logfmt records such as route=/api status=500 dur=42ms, or a CSV/TSV table with a header row. JSON arrays are not the intended input here; split them to one object per line first.
How is the rate calculated?
The tool reads the earliest and latest parseable timestamps in the batch and divides each group's count by that span. It is a batch rate over the log window you pasted, not a moving average. Set Timestamp field to none if the input has no timestamps.
Are the percentiles approximate?
No. Every parsed numeric value is kept, sorted, and reduced exactly. The linear method interpolates between neighbouring values; nearest uses nearest-rank and always returns a value that occurred in the log.
What counts as an error?
Only rows whose Error field matches one of the rules. Blank rules use the built-in set: 5*, error, err, fatal, critical, crit, panic, emerg, and alert. You can also write numeric comparisons such as >=500 or prefixes such as 4*.
Is my log data uploaded?
No. The parser and aggregator are compiled to WebAssembly and run in your browser tab. Logs often contain user IDs, hostnames, URLs, and tokens, so the page is designed for local-only processing.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool log-to-metrics '{"ts":"2024-05-06T07:00:00Z","route":"/api/users","status":200,"duration_ms":37}'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/log-to-metrics/?data=%7B%22ts%22%3A%222024-05-06T07%3A00%3A00Z%22%2C%22route%22%3A%22%2Fapi%2Fusers%22%2C%22status%22%3A200%2C%22duration_ms%22%3A37%7D&format=auto&group_by=route&value_field=duration_ms&percentiles=50%2C95%2C99&percentile_method=linear&time_field=auto-detect%2C%20or%20none&rate_unit=auto&error_field=status&error_values=5%2A%2C%20%3E%3D500%2C%20error%2C%20fatal&limit=20&other=true&sort=count&output=table&metric_prefix=logMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
