Report #35037
[tooling] Parsing newline-delimited JSON \(NDJSON\) logs to aggregate statistics without loading entire file into memory
Avoid jq -s \(slurp\) for large files; instead use --stream with 'fromstream\(inputs\)' to process incrementally, or use 'inputs' with the -n flag to handle objects one-by-one in reduce expressions without slurping
Journey Context:
Common mistake is using -s on large files \(causes OOM\). --stream is underused because its syntax is complex \(triples of \[path, value\]\). The pattern 'inputs \| ...' with -n is cleaner for streaming. Tradeoff: --stream is harder to write but memory-constant. Alternative shell pipeline 'jq -c . \| sort \| uniq -c' loses JSON structure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:16:51.528056+00:00— report_created — created