# JQ to filter JSON by value

> Source: <https://gist.github.com/ipbastola/2c955d8bf2e96f9b1077b15f995bdae3>
> Published: 2016-10-24 09:45:02+00:00

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)
