Having thought about this again I'd use perl.
jq is designed to handle everything from very simple to incredibly complex json files so the filter rules can be complicated and confusing. If you are working with a relatively simple json file you will find it easier (and more intuitive) to use perl regular expression pattern matching and then print the results to your csv file.
You can call your http API request from within the perl script and parse & print the results directly.
If you need help with perl let me know.
|