Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-4895

Zabbix JSONPath could not search items?

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 4.0.1
    • Frontend (F)
    • Zabbix 4.0.0
      CentOS 7.0

      I need to search specific item and get another one. So I have created test json from example at http://jsonpath.com/ from https://www.zabbix.org/wiki/Testing_Of_Preprocessing

      <?php
      
      $data["firstname"] = "John";
      $data["lastName"] = "doe";
      $data["age"] = 26;
      $data["address"]["streetAddress"] = "naist street";
      $data["address"]["city"] = "Nara";
      $data["address"]["postalCode"] = "630-0192";
      $data["phoneNumbers"][0]["type"] = "iPhone";
      $data["phoneNumbers"][0]["number"] = "0123-4567-8888";
      $data["phoneNumbers"][1]["type"] = "home";
      $data["phoneNumbers"][1]["number"] = "0123-4567-8910";
      
      echo json_encode($data);
      ?>
      $.phoneNumbers[?(@.type=="iPhone")].number

      also created HTTP agent and one dependent item, and after all a got this:

      Item preprocessing step #1 failed: cannot extract value from json by path "$.phoneNumbers[?(@.type=="iPhone")].number": unsupported character in json path starting with: "[?(@.type=="iPhone")].number"

      Please add searh item support in JSONPath

            Unassigned Unassigned
            Rostislav Gutsycat
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: