Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-5832

Allow macros to be escaped within item key parameters

XMLWordPrintable

      Please provide a way to avoid the substitution of macros within an item key definition.

      For example:
      Macro: {$USER_MACRO}=>bar
      Item key: foo["{$USER_MACRO}"]

      can not be referenced correctly in items of type "Zabbix aggregate".
      I tried it in several ways without success:
      grpsum["Example Group","foo[\"{$USER_MACRO}\"]",last,0] --> foo["bar"]
      grpsum["Example Group","foo[\"{\$USER_MACRO}\"]",last,0] --> foo["{\$USER_MACRO}"]
      grpsum["Example Group","foo[\"{$$USER_MACRO}\"]",last,0] --> foo["{$$USER_MACRO}"]
      grpsum["Example Group","foo[\"\{$USER_MACRO\}\"]",last,0] --> foo["\{$USER_MACRO\}"]

      And if I haven't overlooked something in the source code such a behavior is actually not implemented.

      The only way to work-around this issue was adding another user macro which is set to the origin user macro definition and use this instead:
      Macro: {$USER_MACRO}=>bar
      Macro: {$USER_MACRO_BAR}=>{$USER_MACRO}
      Item (Zabbix aggregate): grpsum["Example Group","foo[\"{$USER_MACRO_BAR}\"]",last,0] => foo["bar"]

            Unassigned Unassigned
            okkuv9xh Marc
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: