I have JSON output from curl query I did and I am creating another array which later on I will use to create HTML (or CSV and then HTML) in step by step process. However, I always get a what jq says is error though I see it as informative message as command as such works just fine.
This I can reproduce from CLI and script (where I actually noticed it first) jq provides error statement which is not actually error as exit code is 0 and output provided is correct. In essence, I run something like this:
/bin/jq 'map (select (.completionStatus == "Failed") | {"Type" : .type, "Start Time" : .startTime, "Command" : .command, "End Time" : .endTime, "Workflow" : .workflowName, "Run On Host" : .runOnHost, "Error message" : .message})' inputfileThe error is:
jq: error (at inputfile:1): Cannot iterate over number (810)Of course, input file has 810 lines and all is well. I can redirect error to null (and that works by just adding 2> /dev/null), but I assume there must be something neater.