Reputation: 1036
I have the following json file:
{
"HostedZones": [
{
"Id": "Z3JX6LQV6IJO3E",
"Name": "sandbox.mydomain.com."
},
{
"Id": "Z13M9NFG2E4J5N",
"Name": "internal.mydomain.com."
}
]
}
I am using jq and want to get the "Id" value of the object where 'Name' is 'internal.mydomain.com.'.
Upvotes: 1
Views: 173
Reputation: 85580
Use select()
filter on the name and get the id value with the following filter
jq '.HostedZones[] | select (.Name=="internal.mydomain.com.").Id'
Upvotes: 1