I've been trying to get dynamic channels from a JSON file but been having issues. I need a list of the labels and their error statuses for each entry in my JSON file. There should only be about 7 results so i shouldn't be close to the 50 channel limit. In the simplified file i've included below the more children// sections actually go another 8 or 9 sublevels but i'm only interested in results from the top layer.
{ "executionTime": { "millis": 128, "seconds": 0 }, "result": { "Plan": [ { "error": "OK", "TimeOut": 0, "label": "Lable 1", "planId": 135, "planParts": { ~more children~ }, "status": "STOPPED" }, { "error": "OK", "TimeOut": 0, "label": "Label 2", "planId": 140, "planParts": { ~more children~ }, "status": "STOPPED" }, { "error": "OK", "TimeOut": 0, "label": "Label 3", "planId": 141, "planParts": { ~more children~ }, "status": "STOPPED" }, ] }, "returnCode": 0 }
After reading over this and this i've ended up with the below template
{ "prtg": { "result": [ { "value": { #1 : $.. ({ @.label : @.error[0]})} } ] } }
But this just gives me one channel consisting of the Response Time. Can you help me out on what i'm missing here?
Thanks
Add comment