4.2. Configuring output format
When you check policy compliance by using the roxctl deployment check or roxctl image check commands, you can specify the output format by using the -o option to the command and specifying the format as json, table, csv, or junit. This option determines how the output of a command is displayed in the terminal.
For example, the following command checks a deployment and then displays the result in csv format:
$ roxctl deployment check --file =<yaml_filename> -o csv
When you do not specify the -o option for the output format, the following default behavior is used:
-
The format for the
deployment checkand theimage checkcommands istable. -
The default output format for the
image scancommand isjson. This is the old JSON format output for compatibility with older versions of the CLI. To get the output in the new JSON format, specify the option with format, as-o json. Use the old JSON format output when gathering data for troubleshooting purposes.
Different options are available to configure the output. The following table lists the options and the format in which they are available.
| Option | Description | Formats |
|---|---|---|
|
| Use this option to display the JSON output in a compact format. |
|
|
| Use this option to specify custom headers. |
|
|
| Use this option to omit the header row from the output. |
|
|
| Use this option to specify GJSON paths to select specific items from the output. For example, to get the Policy name and Severity for a deployment check, use the following command: $ roxctl deployment check --file=<yaml_filename> \
-o table --headers POLICY-NAME,SEVERITY \
--row-jsonpath-expressions="{results..violatedPolicies..name,results..violatedPolicies..severity}"
|
|
|
| Use this options to merge table cells that have the same value. |
|
|
| Use this option to include the header row as a comment in the output. |
|
|
| Use this option to specify the name of the JUnit test suite. |
|