Jim, What you're seeing definitely sounds strange. I'm not exactly sure what to suggest other than removing various parts until you able to track down which is causing the weirdness.
Assuming I'm understanding your jq command, one thing that doesn't look right though is the endpoint and what you're attempting to filter for. The cluster endpoint does not contain system diagnostics or flow file repository storage usage. Those come from the /nifi-api/system-diagnostics endpoint. Matt On Fri, Jun 17, 2016 at 6:18 AM, Jim Largent <[email protected]> wrote: > I have a strange problem. I tried to access the cluster master via the > rest api with curl in a bash shell script. In the previous version, it > works fine. I make the request, pipe it to JQ and filter out the elements > that I want. I do the exact same command as in the shell script and it > works fine on the command line (produces json). In the shell script I > redirected the output to a file and it is in XML. I tried setting the > header value for curl (-H 'Accept: application/json') but it doesn't have > an affect in the shell. > > Here's the command that I'm using: > curl -H 'Accept: application/json' -s1 -k -E/path/to/pemfile > https://${MASTER_URL}/nifi-api/cluster > | jq -c '.systemDiagnostics | .flowFileRepositoryStorageUsage' > > in the script this causes the "parse error: Invalid numeric literal at line > 1, column 6" error. > > Instead of piping to jq, if I redirect to a file, the file contains XML. > > Any thoughts? >
