I'm assuming you want to get the logGroups entries that don't have a retentionInDays key at all.
$ jq '.logGroups[] | select( has("retentionInDays") == false )' file.json
{
"storedBytes": 0,
"metricFilterCount": 0,
"creationTime": 1245,
"logGroupName": "/aws/elasticbeanstalk/nginx",
"arn": "longarnhere"
}
If you want an array of these (likely, if there may be more than one):
$ jq '[ '.logGroups[]logGroups | map(select( has("retentionInDays") == false ) ]')' file.json
[
{
"storedBytes": 0,
"metricFilterCount": 0,
"creationTime": 1245,
"logGroupName": "/aws/elasticbeanstalk/nginx",
"arn": "longarnhere"
}
]
You could also use has("retentionInDays") | not in place of has("retentionInDays") == false.