JQ to filter JSON by value
Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'
Example: To get json record having _id equal 611
cat my.json | jq -c '.[] | select( ._id | contains(611))'
Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)
This comment has been minimized.
if searching for exact value don't use contains as that is substring/array lookup )
use
==
i.e.
And if your input is not a large array, but rather individual lines of json then use