[ZBX-13435] Can't create item prototype with {#MACRO} as key Created: 2018 Feb 05  Updated: 2018 Feb 05  Resolved: 2018 Feb 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Dmitry Verkhoturov Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File macro_problem.png    

 Description   

When I try to create item prototype with key "{#MACRO}", it won't let me with following error:
Invalid key "{#MACRO}" for item prototype "{#MACRO}" on "Template": incorrect syntax near "{#MACRO}".

Second MACRO in message above is item name. "{#MACRO}" doesn't work, "metric[{#MACRO}]" does.
I thought this over and don't think there is a real problem, looks like validation of this field is incorrect.



 Comments   
Comment by Dmitry Verkhoturov [ 2018 Feb 05 ]

Zabbix version is 3.4.4. Please, fix original comment formatting - I've messed up a little.

Comment by Kaspars Mednis [ 2018 Feb 05 ]

It is not just validation, it is by design. Zabbix does not support such item syntax.
Macros can be used only in key params, not in key names themselves.

In metric[{#MACRO}] your macro is passed as parameter, in {#MACRO} you are trying to pass it as key name.

Regards,
Kaspars

Generated at Wed Jun 03 19:55:57 EEST 2026 using Jira 10.3.18#10030018-sha1:5642e4ad348b6c2a83ebdba689d04763a2393cab.