Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17242

Zabbix 4.2 cannot extract value from json by path for Preprocessing

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Cannot Reproduce
    • Icon: Trivial Trivial
    • None
    • 4.2.7
    • API (A), Server (S)
    • Centos 7.5

      Good afternoon!

      I am unable to perform preprocessing with JSONPath.
      My preprocessing JSONPath - $.data.result.value
      I want get "value" which in this case is 3
      My Json data:

      { 
         "status":"success",
         "data":{ 
            "resultType":"vector",
            "result":[ 
               { 
                  "metric":{ 
                     "__name__":"kafka_brokers",
                     "instance":"10.0.3.18:9308",
                     "job":"kafka_exporter"
                  },
                  "value":[ 
                     1580296145.761,
                     "3"
                  ]
               }
            ]
         }
      }
      

      I get an error:

      Preprocessing failed for: {"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"kafka_brokers"...
      1. Failed: cannot extract value from json by path "$.data.result.metric.instance": no data matches the specified path
      

      For this setting, I followed the official Zabbix documentation.

            Unassigned Unassigned
            F Tatyana
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: