Use the select
filter of jq
:
jq '.zk_kafka | .[] | select(.InstanceType == "t2.medium")'
Use the --arg
option to pass an argument to the query to avoid injections.
jq --arg instance "t2.medium" '.zk_kafka | .[] | select(.InstanceType == $instance)'
jq
has a manual, a tutorial and a cookbook.