[ZBX-22130] JSON null is converted to "null" Created: 2022 Dec 22 Updated: 2024 Apr 10 Resolved: 2024 Feb 05 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P) |
Affects Version/s: | 6.0.12 |
Fix Version/s: | 6.0.27rc1, 6.4.12rc1, 7.0.0beta2, 7.0 (plan) |
Type: | Problem report | Priority: | Trivial |
Reporter: | FP | Assignee: | Andris Zeila |
Resolution: | Fixed | Votes: | 5 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() |
Team: | |
Sprint: | S2401-2 |
Story Points: | 0.25 |
Description |
Steps to reproduce:
Expected:
|
Comments |
Comment by Yurii Polenok [ 2023 Feb 15 ] |
Upgraded from 6.2.4 to 6.2.7. [{ "MONITORNAME": "Create_Autodiscover", "CRITICAL": null }, { "MONITORNAME": "Extract_generic_data_w33", "CRITICAL": null }] jsonpath: $[?(@.MONITORNAME=="Create_Autodiscover")].CRITICAL Return: [null] But it should be just an empty array: [] Not sure, but it seems changed after |
Comment by Yurii Polenok [ 2023 Feb 15 ] |
Also similar problem. [{ "NAME": "versus", "REPORT_NAME": null, "SEVERITY": "major", "NOT_GENERATED": "0", "CONTENT_SEND_ERROR": "0", "INFRA_SEND_ERROR": null, "SENDING_HALTED": "0", "NGC_JOB_HALTED": "0" }, { "NAME": "mansion", "REPORT_NAME": null, "SEVERITY": "critical", "NOT_GENERATED": "0", "CONTENT_SEND_ERROR": "0", "INFRA_SEND_ERROR": "0", "SENDING_HALTED": "0", "NGC_JOB_HALTED": "0" }] jsonpath: $[?(@.NAME=="versus" && @.SEVERITY=="major" && (@.NOT_GENERATED>0 || @.CONTENT_SEND_ERROR>0 || @.INFRA_SEND_ERROR>0 || @.SENDING_HALTED>0 || @.NGC_JOB_HALTED>0))] Result: [{ "CONTENT_SEND_ERROR": "0", "CASINO_NAME": "versus", "INFRA_SEND_ERROR": null, "NGC_JOB_HALTED": "0", "SENDING_HALTED": "0", "REPORT_NAME": null, "NOT_GENERATED": "0", "SEVERITY": "major" }] Why "INFRA_SEND_ERROR": null more then 0? |
Comment by Sandro Bordacchini [ 2023 Mar 07 ] |
I have the same exact problem with a backuppc monitored host and upgraded zabbix from version 1:6.0.5-1+debian11 up to version 1:6.0.13-1+debian11. |
Comment by Przemyslaw Jagielski [ 2023 Apr 17 ] |
On version's from 6.2 branch, i've the same error. |
Comment by Sandro Bordacchini [ 2023 Apr 28 ] |
For more info on my issue please check out this issue I opened on a zabbix template github. |
Comment by Simon D. [ 2023 Jun 01 ] |
Same problem here. I've tried to add a preprocessing step (on first place) who replace null with 0 But value is not changed. Perhaps I've made a mistake |
Comment by Daniel B [ 2023 Sep 14 ] |
Same Problem here, updating from 6.0.6 to anything newer breaks some custom templates. The triggers are firing, because the JSONPath return "null", not nothing. |
Comment by Sandro Bordacchini [ 2023 Dec 19 ] |
No ETA for this issue? Thanks... |
Comment by Andris Zeila [ 2024 Jan 18 ] |
The null value comparison in jsonpath expression is going to be fixed here. null value is less than all other value types. The null value returned as 'null' rather than empty string '' seems to be universal approach going by multiple online jsonpath testers I checked. Either way it's ambiguous result - after returning as string there is no way to tell if the original value was null or 'null' or '' whatever approach is chosen. Possible workarounds for the original issue:
Of course with this real errors containing string 'null' would be ignored, but is is likely to have such error? That depends on the application. |
Comment by Andris Zeila [ 2024 Feb 02 ] |
Released
|