[ZBXNEXT-4895] Zabbix JSONPath could not search items? Created: 2018 Dec 03  Updated: 2019 Jul 31  Resolved: 2019 Jul 31

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F)
Affects Version/s: 4.0.1
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Gutsycat Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: frontend, jsonpath
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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



 Comments   
Comment by Glebs Ivanovskis [ 2018 Dec 06 ]

Duplicates ZBXNEXT-4502.

Comment by Alexei Vladishev [ 2019 Jul 31 ]

Closed as duplicate.

Generated at Fri Apr 26 12:34:38 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.