All Tools View Categories About Contact Privacy

Kubernetes Pod Log Formatter

Align structured (zap-style) and plain pod log lines.

Runs entirely in your browser — your logs never leave this page.
0
Lines
0
Structured
0
Warn
0
Errors

    

About Kubernetes Pod Log Formatter

Kubernetes pod logs are usually structured or half-structured: zap output carrying level, ts, caller, msg plus a bag of context keys, sitting next to plain stderr text from libraries. Kubernetes Pod Log Formatter parses the structured records and produces aligned columns — time | level | caller | message | extra — while leaving plain lines readable.

Epoch-fraction timestamps are converted to ISO, unlisted context keys become key=value after the message, and a per-level count gives an instant health read of the pod's output.

Each pasted line is checked independently: if it starts with { and parses as JSON, it is treated as a zap-style structured record — level, ts, caller and msg/message are pulled into their own columns, and every remaining key (request IDs, status codes, latencies, nested objects) is serialized after the message as key=value pairs so no context is lost even though it is not part of the fixed column layout. If ts is a JSON number it is read as epoch seconds (fractional part included) and converted to an ISO 8601 UTC string; if it is already a string it passes through unchanged. Lines that are not JSON are still useful: an ISO timestamp prefix is pulled out if present, and a bracketed level tag like [WARN] or [ERROR] is recognized so plain fmt.Println/logrus-text output still gets a level column and counts toward the warn/error totals, even though it never had a caller field to show.

Features

  • Structured and plain line support — both formats render in the same column layout.
  • zap-style field extraction — level, ts, caller, msg plus arbitrary context keys.
  • Epoch to ISO timestamp conversion — fractional epoch seconds become readable UTC timestamps.
  • Aligned columns with key=value tail — context fields stay attached to their record without breaking alignment.
  • Level counts and TSV export — a one-click tab-separated version for spreadsheets or further scripting.
  • Local only — nothing uploaded, all parsing happens in the tab.

How to Use

  1. Paste pod output — from kubectl logs, a dashboard, or a saved log file.
  2. Set the timestamp column width if the default doesn't fit your longest timestamp, then click Format.
  3. Review — structured records become aligned columns; plain lines stay intact and readable next to them.
  4. Read the level counts, then copy the formatted text or export TSV for a spreadsheet.

Examples

Example 1 — zap run. {"level":"error","ts":1700000000.123,"caller":"server.go:50","msg":"request failed","code":500} renders with the error level visible in its own column and code=500 preserved in the extra tail.

Example 2 — Mixed output. A Go app emitting both JSON log lines and plain fmt.Println debug output formats uniformly side by side, so you don't need two different tools to read one pod's combined stdout.

Example 3 — Crashloop triage. Level counts surface a burst of errors instantly, and the aligned caller column points straight at the failing file and line without hunting through raw JSON.

Example 4 — Spreadsheet analysis. Export TSV and paste it into a spreadsheet to pivot on level or caller across a long-running pod's history.

Benefits

  • Uniform view — structured and plain lines read side by side in one layout.
  • Time normalized — epoch fractions converted to ISO so timestamps are comparable across services.
  • Context preserved — every extra key is rendered, not dropped, even nested objects.
  • Instant health — level counts give a pod's error/warn rate at a glance.
  • Private — all formatting happens client-side.

Frequently Asked Questions

Which log shapes does it handle?
Structured JSON lines from zap-style loggers — fields like <code>level</code>, <code>ts</code>, <code>caller</code>, <code>msg</code> plus arbitrary context — and plain text lines, which are kept intact while a level is detected if one appears.
How are zap-style timestamps converted?
Numeric <code>ts</code> values (epoch seconds with fraction, as JSON numbers) become ISO 8601 UTC. ISO strings pass through unchanged, and lines without any timestamp fall back to a dash.
What happens to the extra context fields?
Everything outside <code>level</code>, <code>ts</code>, <code>caller</code>, and <code>msg</code> is rendered as <code>key=value</code> after the message, so you keep the full record and the aligned core columns.
Does it flatten nested values?
Nested objects and arrays are JSON-serialized inline into the key=value tail, keeping the column layout intact.
Is my data uploaded?
No. Formatting runs entirely in your browser.