I am trying to extract a value from a JSON query, but it is not accepting the value that I am inserting.
The confusing thing is that if I run the same value within a JSON online tester, I a syntax error.
below is the result of running the following command.
zabbix_get -s 127.0.0.1 -k speedtest-cli
resulting data.
{"download": 728279569.2356068, "upload": 673805038.8042076, "ping": 7.978, "server": {"url": "http://speedtest.trined.nl:8080/speedtest/upload.php", "lat": "xxxxxx", "lon": "xxxxx", "name": "Sint-Oedenrode", "country": "Netherlands", "cc": "NL", "sponsor": "TriNed B.V.", "id": "xxxxxx", "host": "speedtest.trined.nl:8080", "d": 21.930530770089096, "latency": 7.978}, "timestamp": "2020-12-09T08:05:38.034802Z", "bytes_sent": 151519232, "bytes_received": 409373932, "share": null, "client": {"ip": "xxx.xxx.xxx.xxx", "lat": "xxxxxxx", "lon": "xxxxxx", "isp": "CAIW Internet", "isprating": "3.7", "rating": "0", "ispdlavg": "0", "ispulavg": "0", "loggedin": "0", "country": "NL"}}
within an online portal https://www.jsonquerytool.com/ I test the following value $.server.latency and get a result below. which if you look at the output above, that matches the latency value. This is what I am looking to get.

So with this logic, I created an item and within that item I added pre-processing.

I am trying to extract the latecy to my ISP server.

The issue is when I use the tested online query value, it fails the test.

After running the test from within the zabbix test, I get the following error.

I have tried to place both { and [ brackets in various locations and I cannot get any of them to pass the test.
What is wrong with my syntax.
Any ideas, any help is appreciated.
Thanks
Lawrence
The confusing thing is that if I run the same value within a JSON online tester, I a syntax error.
below is the result of running the following command.
zabbix_get -s 127.0.0.1 -k speedtest-cli
resulting data.
{"download": 728279569.2356068, "upload": 673805038.8042076, "ping": 7.978, "server": {"url": "http://speedtest.trined.nl:8080/speedtest/upload.php", "lat": "xxxxxx", "lon": "xxxxx", "name": "Sint-Oedenrode", "country": "Netherlands", "cc": "NL", "sponsor": "TriNed B.V.", "id": "xxxxxx", "host": "speedtest.trined.nl:8080", "d": 21.930530770089096, "latency": 7.978}, "timestamp": "2020-12-09T08:05:38.034802Z", "bytes_sent": 151519232, "bytes_received": 409373932, "share": null, "client": {"ip": "xxx.xxx.xxx.xxx", "lat": "xxxxxxx", "lon": "xxxxxx", "isp": "CAIW Internet", "isprating": "3.7", "rating": "0", "ispdlavg": "0", "ispulavg": "0", "loggedin": "0", "country": "NL"}}
within an online portal https://www.jsonquerytool.com/ I test the following value $.server.latency and get a result below. which if you look at the output above, that matches the latency value. This is what I am looking to get.
So with this logic, I created an item and within that item I added pre-processing.
I am trying to extract the latecy to my ISP server.
The issue is when I use the tested online query value, it fails the test.
After running the test from within the zabbix test, I get the following error.
I have tried to place both { and [ brackets in various locations and I cannot get any of them to pass the test.
What is wrong with my syntax.
Any ideas, any help is appreciated.
Thanks
Lawrence
Comment