Difference between revisions of "Cannot iterate over null"
Jump to navigation
Jump to search
(Created page with " jq: error (at <stdin>:1904): Cannot iterate over null (null)") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[jq | + | |
+ | [[jq]]: error (at <stdin>:1904): Cannot iterate over [[null]] (null) | ||
+ | |||
+ | [[aws ec2 describe-instances]] --query 'Reservations[*].Instances[?not_null(PublicIpAddress)]' | jq -r '.[][]|.PublicIpAddress+" "+(.Tags[]|select(.Key=="Name").Value)' | ||
+ | |||
+ | Remove Tags filter to avoid list of IPs to be truncated and get full list: | ||
+ | [[aws ec2 describe-instances]] --query 'Reservations[*].Instances[?not_null(PublicIpAddress)]' | jq -r '.[][].PublicIpAddress' | ||
+ | |||
+ | |||
+ | == See also == | ||
+ | * {{jq}} | ||
+ | |||
+ | [[Category:jq]] |
Latest revision as of 11:10, 30 June 2022
jq: error (at <stdin>:1904): Cannot iterate over null (null) aws ec2 describe-instances --query 'Reservations[*].Instances[?not_null(PublicIpAddress)]' | jq -r '.[][]|.PublicIpAddress+" "+(.Tags[]|select(.Key=="Name").Value)' Remove Tags filter to avoid list of IPs to be truncated and get full list: aws ec2 describe-instances --query 'Reservations[*].Instances[?not_null(PublicIpAddress)]' | jq -r '.[][].PublicIpAddress'
See also[edit]
Advertising: