reportsquery command

The reportsquery command allows you to query the reportsqueries endpoint of the Microsegmentation Console API.
You must pass a valid report type as the first parameter. That can be one of:

Querying

Formatting options

You can control the output format using the --output flag. Supported output formats are:
  • table
  • json
  • yaml
  • none
  • template
When using the table format, you can adjust the columns of the table using the --column flag by supplying a list of attributes.
For example:
apoctl reportsquery flows --output table --column ID,namespace --log-level debug --from-rel 2h

Filtering results

You can filter reports by supplying a custom filter expression using the --filter flag.
For example:
apoctl reportsquery flows --filter 'sourceType == "ProcessingUnit"'

Recursive queries

You can list all reports of the chosen type in the namespace and all its child namespaces by using the flag --recursive.
For example:
apoctl reportsquery flows --namespace /my/namespace --recursive

Defining a query time window

You can define the query time window with the flags --from, --to, --from-rel or --to-rel. If you don’t set any time limit, apoctl will make a call on the last hour.
To pass a relative time window:
apoctl reportsquery flows --recursive --from-rel 10s --namespace /my/namespace --filter 'id == xxxx'
To pass an absolute time window:
apoctl reportsquery flows --recursive --from 2018-01-01 --to 2018-02-02
The complete list of supported date formats is described at https://github.com/araddon/dateparse.

Recommended For You