I am using curl to pull Alien Vault OTX pulses from their API, the initial output I receive is in json format and I need to convert this json into csv as so it can be read by so
.results is an array so you'll have to expand it too. This can be done either by:
.results[] | .indicators[] | [.indicator, .type] | @csv
or more compactly:
.results[].indicators[] | [.indicator, .type] | @csv
You'll also have to direct the output to the designated file, e.g.:
jq -r -f program.jq < AV.json > AV.csv
"CVE-2018-0802","CVE"
"fb9c9cbf6925de8c7b6ce8e7a8d5290e628be0b82a58f3e968426c0f734f38f6","FileHash-SHA256"