list command transforms inputted JSON objects into
|Names of properties to show||❌|
If no properties are provided, a predefined list of properties will be shown:
/reported.kind as kind
/reported.id as id
/reported.name as name
/reported.age as age
/reported.last_update as last_update
/ancestors.cloud.reported.name as cloud
/ancestors.account.reported.name as account
/ancestors.region.reported.name as region
/ancestors.zone.reported.name as zone
If properties are provided, it will override the defaults and only show the defined properties. Property paths can be absolute (i.e., include a section name, such as
metadata). If the section is not defined, the
reported section is assumed.
The defined property path will be searched for within every element in the JSON input. If the value is defined, it will be a part of the list. Undefined values are filtered out and will not be printed.
The property name can be defined via an
reported.kind as kind would look up the path
reported.kind and if the value is defined write
as clause is defined, the name of the last element of the property path is taken. In the example above, we could write
reported.kind as kind; both would have the same result.
as clause is important if the last part of the property path is not a unique property name.
|Format output as Markdown||❌|
|Format output as CSV||❌|
> search is(aws_ec2_instance) limit 3 | list
kind=aws_ec2_instance, id=1, name=sun, ctime=2020-09-10T13:24:45Z, cloud=aws, account=prod, region=us-west-2
kind=aws_ec2_instance, id=2, name=moon, ctime=2021-09-21T01:08:11Z, cloud=aws, account=dev, region=us-west-2
kind=aws_ec2_instance, id=3, name=star, ctime=2021-09-25T23:28:40Z, cloud=aws, account=int, region=us-east-1
> search is(aws_ec2_instance) limit 3 | list kind, name
> search is(aws_ec2_instance) limit 3 | list kind as a, name as b
> search is(aws_ec2_instance) limit 3 | list kind as a, name as b, does_not_exist