jq: Select entry from list of objects for which key equals value

This example selects, given a list of JSON entries, all entries where .service equals "mongodb" (i.e. {"service": "mongo"}:

jq_select_mongo.sh
jq 'map(select(.service=="mongo"))'

 


Check out similar posts by category: Linux