[ZBX-21615] Backslash is not escaped in macro value when it's resolved in trigger expression string parameter Created: 2022 Sep 08  Updated: 2024 Aug 12  Resolved: 2024 Apr 17

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.9rc1, 6.2.3rc1, 6.4.0alpha1
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Sergejs Olonkins Assignee: Zabbix Development Team
Resolution: Cannot Reproduce Votes: 0
Labels: escaping, macro, values
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screenshot-1.png    
Team: Team C
Sprint: Sprint 92 (Sep 2022), Sprint 93 (Oct 2022), Sprint 94 (Nov 2022), Sprint 95 (Dec 2022), Sprint 96 (Jan 2023), Sprint 97 (Feb 2023), Sprint 98 (Mar 2023), Sprint 99 (Apr 2023), Sprint 100 (May 2023), Sprint 101 (Jun 2023), Sprint 102 (Jul 2023), Sprint 103 (Aug 2023), Sprint 104 (Sep 2023), Sprint 105 (Oct 2023), Sprint 106 (Nov 2023), Sprint 107 (Dec 2023), Sprint candidates, S2401, S24-W6/7, S24-W8/9
Story Points: 0.25

 Description   

Problem description: if macro value contains an escape symbol (backslash) and double quotes, and this macro is used in a string parameter of a trigger expression (or in calculated item formula), then the double quotes are escaped in the resolved macro value, but the escape symbol is not.

Steps to reproduce:

  1. Create a host with a numeric item
  2. Add host macro that contains both double quotes and a backslash in its value, for example: "\aaa"
  3. Add a trigger with function find() and use this host macro in parameter "V", like so:
     find(/test/trap,5h,"eq",{$A})=0 
  4. Send some numeric value to the previously created item
  5. Check the error message in the list of triggers

Result: In the error message he double quotes are escaped, but the backslash is not:

Cannot evaluate function find(/test/trap,5h,"eq","\"\aaa\""): ""\aaa"" is not a valid numeric float value.

Expected: the backslash should be escaped, same as the double quotes.



 Comments   
Comment by Alexander Vladishev [ 2024 Apr 17 ]

This issue is no longer reproducible in the latest versions 6.0 and 6.4, as well as in pre-7.0.0. It's likely that it has been resolved as part of other tasks, such as ZBX-21898.

Closing as 'Cannot reproduce'.

Generated at Mon Jun 30 08:04:07 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.