Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 612

Parse json with jq in AWS CLI

$
0
0

I need an output similar to this:

{"InstanceType": "c4.xlarge","PrivateIpAddress": "10.54.130.52","PlatformDetails": "Windows BYOL","State":"Name": "running"  }}

Reading the documentation of the jq command I have reached the next output:

aws ec2 describe-instances --instance-ids i-0079e143722b0b8f9 | jq -r '.Reservations[].Instances[] | {InstanceType, PrivateIpAddress, PlatformDetails, State}'{"InstanceType": "c4.xlarge","PrivateIpAddress": "10.54.130.52","PlatformDetails": "Windows BYOL","State": {"Code": 16,"Name": "running"  }}

Can anyone explain how to do that?


Viewing all articles
Browse latest Browse all 612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>