Search code examples
sqljsonjsonpathzabbix

How to get VALUE by KEY in Json?


Given:

 [{"{#NAME}":"BULL","{#VALUE}":"98.03"},{"{#NAME}":"BILL","{#VALUE}":"98.32"}]

How get VALUE by NAME ?

My code didn't working :(

$['{#NAME}']['VALUE']

Solution

  • Assuming you are using the JSONPath preprocessing, the correct filter is $['{#NAME}'].

    You can use https://jsonpath.com/ to do your tests since Zabbix doesn't have a similar feature (yet).