Combine multiple scan results
It might be useful to create a single file with results from multiple different scans. The combined file can be used to look at all scan results in a single view, or can be passed to other commands as well.
How to combine the results depends on the format of the resulted file.
JSON
If the output file format is JSON, combining multiple results is simple. As the format is a json-lines, each line is completely independent, and you can concatenate all the result files:
Example
Scan two different vault clusters and create a combined index. See index vault for information about creating an index.
Scan a Vault cluster and store the result in
vault-index-1.jsonl
.Scan another Vault cluster and store the result in
vault-index-2.jsonl
.Combine the two scan results.
CSV
Each CSV file has a header line, so just combining files will not properly work.
To combine a combination of head
and tail
commands can be used.
Example
Scan two git repositories and create a combined file.
Scan a git repository and store the result in
scan-repo-results-1.csv
.Scan another git repository and store the result in
scan-repo-results-12.csv
.Combine the two scan results.
Note
As a best practice, combine CSV results form the same command. For example,
combine the returned results from the scan repo
command. Combining results
from different commands, (e.g. scan repo
and scan folder
) will not properly
work as different commands have different columns.