Report #103001
[tooling] Need to extract or filter JSON fields in a shell pipeline without writing a script
Use jq with raw output and tabular transforms: \`cat data.json \| jq -r '.items\[\] \| select\(.status == "active"\) \| \[.id, .name\] \| @tsv'\`. Combine \`map\`, \`select\`, \`from\_entries\`, and \`//\` defaults to reshape APIs on the fly.
Journey Context:
Piping JSON through \`grep\`/\`sed\` is brittle because it treats the payload as text. jq treats JSON as structured data; \`select\` filters, \`map\` transforms arrays, and \`@tsv\`/\`@csv\` emit shell-friendly rows. The \`-r\` flag strips quotes so values can be fed into \`xargs\` or \`while read\`. A common mistake is forgetting that \`.\[\]\` produces a stream and needs wrapping in \`\[...\]\` when you want an array.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:50:52.024702+00:00— report_created — created