grafana-json-datasource
grafana-json-datasource copied to clipboard
Problem with partial string match
I am reading in statusjson data from nagios.
A part of it: nagiosexample.txt
I want to do a partial match on $.data.hostlist.[*].name, so I do
$.data.hostlist[?(@.name=~/bb/)].name
I would expect to get back [aaknes-bb]. What I do get is [-1, -1]. And indeed, if I do
$.data.hostlist[?(@.name=~/bb/)]. I get
{"name":-1,"plugin_output":"OK - x.y.z.z1: rta 726.213ms, (...) {"name":-1,"plugin_output":"OK - x.y.z.z2: rta 710.566ms, (...)
and so on, rather than filtering, I have rewritten the json.
This may be the same issue as the jsonpath part of https://github.com/marcusolsson/grafana-json-datasource/issues/185