When working with gcloud CLI, sometimes there are strong needs to filter and format the output for subsequent processing.
A use case for example here:
1 | gcloud compute instances \ |
The filter
and format
are explained under
gcloud topic group, you
can find other useful topics about gcloud.
Resource Available Key
To find the keys
for filter and format, check --format flattened
option, it lists all keys
for the specified resource.
Filter Syntax
https://cloud.google.com/sdk/gcloud/reference/topic/filters
Format Syntax
https://cloud.google.com/sdk/gcloud/reference/topic/formats
Projection Syntax:
https://cloud.google.com/sdk/gcloud/reference/topic/projections