Open stamina11 opened 3 years ago
I think the issue is that the provided example isn't a mapped object, it's nested JSON.
{
"status": "ok",
"info": {
"EVENT_GRID": {
"status": "up",
"system": "Event Grid",
"details": "Event Grid is online."
}
}
}
vs. (as in the example config)
{
"status": "ok",
"info": [
{
"EVENT_GRID": {
"status": "up",
"system": "Event Grid",
"details": "Event Grid is online."
}
}
]
}
I know this is not the best looking json but that's all i get to work with from our developers. Any chance to make this work? jsonpath.com is showing that it should work.
Json:
{ "status": "ok", "info": { "EVENT_GRID": { "status": "up", "system": "Event Grid", "details": "Event Grid is online." } } }
Query: `
Error:
son_exporter | level=error ts=2021-03-04T23:52:03.713Z caller=collector.go:128 msg="Failed to execute jsonpath" err="map[EVENT_GRID:map[details:Event Grid is online. status:up system:Event Grid]] is not array or slice and cannot be filtered" path="{.info[?(@.status==\"down\")]}" data="{\"status\":\"ok\",\"info\":{\"EVENT_GRID\":{\"status\":\"up\",\"system\":\"Event Grid\",\"details\":\"Event Grid is online.\"}},\"error\":{},\"details\":{\"EVENT_GRID\":{\"status\":\"up\",\"system\":\"Event Grid\",\"details\":\"Event Grid is online.\"}}}" json_exporter | level=error ts=2021-03-04T23:52:03.713Z caller=collector.go:69 msg="Failed to extract json objects for metric" err="map[EVENT_GRID:map[details:Event Grid is online. status:up system:Event Grid]] is not array or slice and cannot be filtered" metric="Desc{fqName: \"dependencies_up_on\", help: \"API Check\", constLabels: {}, variableLabels: [dep_name]}"
Thanks in advance.