-
Documentation task
-
Resolution: Fixed
-
Trivial
-
4.0.13
-
None
-
Zabbix 4.0.7
PostgreSQL 11
-
Sprint 58 (Nov 2019), Sprint 59 (Dec 2019), Sprint 60 (Jan 2020), Sprint 61 (Feb 2020)
I use contextual macros in trigger expressions all the time which provides flexibility.
The issue I am finding is when using a contextual user macro with a context including LLD macro + quoted regsub inside an expression it fails syntactically.
This occurs when using double quotes for the contextual macro and also to surround the regular expression in the macro function example:
{$USERMACRO:"{
{#LLDMACRO}.regsub("^(.*)$",\1)}"}The documentation states for contextual macros we should use a double quote and the same with the macro functions.
The issue here is the fact we are doing this both at the same time and the strings are not being interpreted correctly example:
String1 = {{#LLDMACRO}
.regsub(
Between = ^(.*)$
String2 = ,\1)}
If we were able to use single quotes as well we would be able to work around it example:
{$USERMACRO:"{
{#LLDMACRO}.regsub('^(.*)$',\1)}"}OR
{$USERMACRO:'{{#LLDMACRO}
.regsub("^(.*)$",\1)}'}