I have the following json:
{"hostNamesDisabled": false,"hostingEnvironmentProfile": null,"httpsOnly": true,"hyperV": false,"identity": {"principalId": null,"tenantId": null,"type": "UserAssigned","userAssignedIdentities": {"<random_object_name>": {"clientId": "xxxx","principalId": "xxxx" } }},"inProgressOperationId": null,"isDefaultContainer": null
}
With jq, I can easily filter keys like:
$ jq -r '.httpsOnly'true
or
$ jq -r '.identity.principalIdnull
and retrieve their respective values, so that I could use them in a shell script as variables.
Question is: how to filter the identity.userAssignedIdentities object to obtain only the <random_object_name> name/content, like so:
$ jq -r '.identity.userAssignedIdentities.???'<random_object_name>
but not the remaining key-value pairs?