Jq Notes: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
Line 4: Line 4:


  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(", ")'
  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(", ")'
to CSV (join on the end ):
azure location list --json | jq '.[] | .name  | join(", ")'

Revision as of 19:47, 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(", ")'


to CSV (join on the end ):

azure location list --json | jq '.[] | .name  | join(", ")'