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

    Details

    • Type: Problem report
    • Status: Closed
    • Priority: Trivial
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.2.7
    • Fix Version/s: None
    • Component/s: API (A), Server (S)
    • Labels:
    • Environment:
      Centos 7.5
    • Team:
      Team A

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            F Tatyana
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: