[ZBX-13556] Not possible to use '-' character in jsonpath expression Created: 2018 Feb 28 Updated: 2024 Apr 10 Resolved: 2018 Apr 06 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D) |
Affects Version/s: | 3.4.7, 4.0.0alpha4 |
Fix Version/s: | 4.0 (plan) |
Type: | Incident report | Priority: | Trivial |
Reporter: | Vladislavs Sokurenko | Assignee: | Martins Valkovskis |
Resolution: | Fixed | Votes: | 0 |
Labels: | dependentitems, jsonpath, preprocessing | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | patch.diff | ||||||||
Issue Links: |
|
||||||||
Team: | Team A | ||||||||
Sprint: | Sprint 30, Sprint 31 | ||||||||
Story Points: | 0 |
Description |
Create dependent item with following jsonpath expression $.header.Content-Type And receive such json through Zabbix Trapper {"header": {"Content-Type": "text/html; charset=UTF-8"}} Actual: item "Zabbix server:Set-Cookie" became not supported: Item preprocessing step #1 failed: cannot extract value from json by path "$.header.Content-Type": object not found starting with json path: "Content-Type" Expected: Patch attached, though should consider allowing even more symbols. |
Comments |
Comment by Glebs Ivanovskis (Inactive) [ 2018 Mar 01 ] |
Patch is not attached. |
Comment by Vladislavs Sokurenko [ 2018 Mar 01 ] |
Thanks ! |
Comment by Viktors Tjarve [ 2018 Mar 26 ] |
Fixed in development branches: |
Comment by Andris Zeila [ 2018 Mar 28 ] |
After the changes json patch components can contain any characters except $@.[],:?(). This means that the following paths would be valid:
They do look strange. Plus control characters would be accepted too. I think they original patch plus check for unicode characters would be better. wiper Actually accepting any unicode character would lead us to unknown territory as well. I looked into some jsonpath online parsers - the accepted symbols depends on implementation (which is not surprising as there is not strict jsonpath specification). |
Comment by Andris Zeila [ 2018 Apr 03 ] |
(1) [D] Document that only alphanumeric + underscore characters can be used in jsonpath dot notation ($.a.b.c). If the json object name contains other characters then bracket notation ($['a']['b']['c']) must be used. Both notations can be mixed ($.a['b'].c). martins-v Added to: Please review. wiper Looks good. |