I am using jq
but having "-" in my json tag make jq
not compile. I cannot escape it to make it works. Here is the command:
curl -X GET -H "X-AppKey:foo" "foo/v2/_status" | jq '.component-status[]'
I have read in the github of jq
this post https://github.com/stedolan/jq/issues/202 but I cannot make it work.
This is the output of the curl
:
{
"status": "ok",
"hostname": "0b0b495a46db",
"component-status": [
{
"status-code": 200,
"component": "Service1",
"status": "OK"
},
{
"status-code": 200,
"component": "Service2",
"status": "OK"
}
]
}
Any idea?