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

Zabbix JSONPath could not search items?

    XMLWordPrintable

    Details

    • Type: Change Request
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 4.0.1
    • Fix Version/s: None
    • Component/s: Frontend (F)
    • Labels:
    • Environment:
      Zabbix 4.0.0
      CentOS 7.0

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Rostislav Gutsycat
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: