Report #48656
[tooling] Safely extracting string values from JSON for shell variables or processing JSON Lines streams
Use \`jq -r '.field'\` \(raw output\) to unquote strings for shell consumption, and \`jq -s '.'\` \(--slurp\) to read a JSON Lines stream into an array for aggregate operations like sorting or grouping
Journey Context:
Without -r, developers pipe jq to sed/tr to remove quotes, which breaks on special characters. Without --slurp, processing JSON Lines \(common in logs\) requires complex reduce operations; slurp loads all into memory as an array enabling simple map/select operations. The tradeoff is RAM usage with large files, for which --stream exists but is complex.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:09:10.477637+00:00— report_created — created