Last active
February 29, 2016 22:36
-
-
Save adampats/55b2d814813eed60e000 to your computer and use it in GitHub Desktop.
aws spot instance requests jq parsing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "CreateTime": "2016-02-29T18:18:48.000Z", | |
| "ImageId": "ami-f7a2bf96", | |
| "InstanceType": "m4.large", | |
| "SpotInstanceRequestId": "sir-039b6k6b", | |
| "SpotPrice": "0.030000", | |
| "State": "cancelled", | |
| "Status": { | |
| "Code": "instance-terminated-by-user", | |
| "Message": "Spot Instance terminated due to user-initiated termination.", | |
| "UpdateTime": "2016-02-29T18:31:29.000Z" | |
| }, | |
| "Type": "persistent" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws ec2 describe-spot-instance-requests | \ | |
| jq -S '.|.SpotInstanceRequests[]|{Status,SpotInstanceRequestId,State,Type,CreateTime,SpotPrice,InstanceType:(.LaunchSpecification.InstanceType),ImageId:(.LaunchSpecification.ImageId)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment