Answer the question
In order to leave comments, you need to log in
How to make a json parser using curl?
I wrote a curl request, which, by design, should give the value of a certain json parameter:
curl --digest -L -D - --user login:password --header "Content-Type: application/json" "http://hostname/management/subsystem/datagrid-infinispan/cache-container/keycloak/distributed-cache/clientSessions?operation=resource&include-runtime=true&json.pretty=1" | jq -r '."number-of-entries-in-memory"'
parse error: Invalid numeric literal at line 1, column 9
curl --digest -L -D - --user login:password --header "Content-Type: application/json" "http://hostname/management/subsystem/datagrid-infinispan/cache-container/keycloak/distributed-cache/clientSessions?operation=resource&include-runtime=true&json.pretty=1" -o result.json && jq -r '."number-of-entries-in-memory"' result.json
Answer the question
In order to leave comments, you need to log in
Your problem is in-D -
curl -s --digest -L --user login:password --header "Content-Type: application/json" "http://hostname/management/subsystem/datagrid-infinispan/cache-container/keycloak/distributed-cache/clientSessions?operation=resource&include-runtime=true&json.pretty=1" | jq -r '."number-of-entries-in-memory"'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question