Jq Notes: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
(Created page with " aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.LaunchTime > "2015-01-28") | select(.State.Code != 48) | [(.Tags[]|select(.Key=="Name")|.Value),.Laun...")
 
No edit summary
Line 1: Line 1:




Selecting name from tags:


aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.LaunchTime > "2015-01-28") | select(.State.Code != 48) | [(.Tags[]|select(.Key=="Name")|.Value),.LaunchTime, .State.Name]'
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.LaunchTime > "2015-01-28") | select(.State.Code != 48) | [(.Tags[]|select(.Key=="Name")|.Value),.LaunchTime, .State.Name] | join(", ")'

Revision as of 19:45, 15 February 2017


Selecting name from tags:

aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.LaunchTime > "2015-01-28") | select(.State.Code != 48) | [(.Tags[]|select(.Key=="Name")|.Value),.LaunchTime, .State.Name] | join(", ")'