aws ec2 describe-vpcs --out json | jq '.Vpcs[] | {VPC:(.Tags[] | select(.Key=="Name").Value), CIDR:.CidrBlockAssociationSet[].CidrBlock}'
- List all VPC's and their CIDR Blocks:
aws ec2 describe-vpcs --out json | jq '.Vpcs[] | (.Tags[] | select(.Key=="Name").Value), .CidrBlockAssociationSet[].CidrBlock'
$ cat archive.json | jq -s 'map(.Contents[].Size) | add'
aws s3api list-objects-v2 --bucket bucket --prefix prefix --out json | jq -r '.Contents[] | [.Key, .Size] | @tsv'
- Return only items matching prefix:
cat files.json | jq -r '.Contents[] | select(.Key|test("^prefix_to_match"))'