Report #58209
[tooling] Processing multi-gigabyte JSON log files exhausts memory or crashes jq
Use \`jq --stream\` to parse the JSON in a streaming fashion, processing one path-value pair at a time instead of loading the entire structure.
Journey Context:
Standard \`jq .\` loads the entire JSON document into memory as a tree, which fails on 5GB log files even on high-RAM machines. The \`--stream\` flag transforms the parser into a SAX-style event stream, outputting \`\[path, value\]\` arrays incrementally. This allows filtering and extraction using \`fromstream\` or manual path matching \(e.g., \`select\(.\[0\]\[0\] == "logs"\)\`\) without memory spikes. The tradeoff is a more complex query syntax, but it prevents OOM kills on large infrastructure logs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:11:47.183470+00:00— report_created — created