Skip to main content

list Command

The list command transforms inputted JSON objects into strings.


list <properties>


ParameterDescriptionRequired?Default Value
propertiesNames of properties to show‚ĚĆ

If no properties are provided, a predefined list of properties will be shown:

  • /reported.kind as kind
  • / as id
  • / as name
  • /reported.age as age
  • /reported.last_update as last_update
  • / as cloud
  • / as account
  • / as region
  • / 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 reported, desired, or 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 as clause. reported.kind as kind would look up the path reported.kind and if the value is defined write kind={value}.

If no 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 or reported.kind as kind; both would have the same result.

The as clause is important if the last part of the property path is not a unique property name.


--markdownFormat output as Markdown‚ĚĆ
--csvFormat output as CSV‚ĚĆ


If all parameters are omitted, the predefined list of properties are shown
> 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
Explicitly define the properties to show without renaming them
> search is(aws_ec2_instance) limit 3 | list kind, name
‚Äčkind=aws_ec2_instance, name=sun
‚Äčkind=aws_ec2_instance, name=moon
‚Äčkind=aws_ec2_instance, name=star
Same as previous, but with overridden property names
> search is(aws_ec2_instance) limit 3 | list kind as a, name as b
‚Äča=aws_ec2_instance, b=sun
‚Äča=aws_ec2_instance, b=moon
‚Äča=aws_ec2_instance, b=star
Properties that do not exist are not printed
> search is(aws_ec2_instance) limit 3 | list kind as a, name as b, does_not_exist
‚Äča=aws_ec2_instance, b=sun
‚Äča=aws_ec2_instance, b=moon
‚Äča=aws_ec2_instance, b=star