[ZBX-25419] Incorrect macro is resolved in problem event name in case if context macro with regex exists and context in trigger configuration contains word "regex" Created: 2024 Oct 21  Updated: 2025 Mar 18  Resolved: 2025 Mar 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.34, 7.0.4
Fix Version/s: 7.0.11rc1, 7.2.5rc1, 7.4.0beta1

Type: Problem report Priority: Minor
Reporter: Sergejs Olonkins Assignee: Mihails Prihodko
Resolution: Fixed Votes: 0
Labels: eventdetails, macrocontext, resolution
Remaining Estimate: Not Specified
Time Spent: 24h
Original Estimate: Not Specified

Issue Links:
Sub-task
Team: Team B
Sprint: S24-W44/45, S24-W48/49, S25-W2/3, S25-W4/5, S25-W6/7, S25-W8/9, S25-W10/11
Story Points: 2

 Description   

Problem description: In case if a host has both macro (for example {$TEST}) and macro with context (like {$TEST:regex:x}) and then this macro is used in trigger expression, then it is possible that the context macro will be resolved with plain macro value in the event details form. To observe the problem, please follow the steps below.

Steps to reproduce:

  1. Create host with the following macros:
    1. {$TEST} =>33
    2. {$TEST:regex:x} => 15
  2. Create a trapper item with key "trap" on this host
  3. Create a trigger that will use the TEST macro in the trigger expression and trigger name:
    trigger {$TEST:regex:abc}
    last(/<host>/trap)>{$TEST:regex:abc}
  4. Send a value to the trapper item, that would be higher then the value of the context macro but lower than the value of the plain user macro, for example 17
  5. Go to Monitoring => Problems and make sure that the problem isn't created
  6. Send a value to the trapper item, that would be higher then the value of the plain user macro, for example 34
  7. Go to Monitoring => Problems and make sure that the problem is created
  8. Open event details of the created problem and check the "Problem name" field

Expected:
The problem should have been created with the item value "17".
The "Problem name" field contains the value of the macro {$TEST}, even though the macro {$TEST:regex:x} should have been resolved when the problem was created, since in the trigger name and trigger expression, the macro contains the context "regex:abc" with the character "x." Please note that the reserved "regex:" prefix should be recognized as such only in the macro configuration and not in the places where it is used.



 Comments   
Comment by Alexander Vladishev [ 2024 Oct 21 ]

On the frontend side, a similar issue will be resolved in ZBX-25208.

Comment by Mihails Prihodko [ 2025 Mar 04 ]

Available in versions:

Generated at Sun Apr 20 20:47:52 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.