Expand description
Log-line parsing — “JSON → columns” (M1.2).
Multi-pod/multi-container log streaming with a regex filter lands the raw line; this module turns structured (JSON) log lines into typed columns so a frontend can show a real table instead of a monochrome string. It is renderer-agnostic: the view-model owns meaning (which columns exist and their typed values); the frontend owns geometry (column widths, truncation).
The schema is inferred from the first JSON line’s keys (stable, first-seen order).
Non-JSON lines are returned as a single _raw column. This is deliberately cheap —
the full OpenAPI/CRD schema validation lands in Phase 2 with the lens engine.
Structs§
- Parsed
LogLine - One parsed log row: the raw line plus a typed column map (empty for non-JSON lines).
Enums§
- LogCell
- A single typed log cell.
Functions§
- infer_
columns - The inferred column schema for a set of parsed lines (first-seen key order is stable
because
BTreeMapsorts keys). - parse_
json_ line - Parse a JSON log line into typed columns. Returns
Nonefor non-JSON lines (the caller keeps the raw line for a_rawcolumn). - parse_
log_ stream - Parse a stream of log lines: JSON lines become typed columns, plain lines keep only the raw text.