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

foreach function not getting data filtered by tag when tag uses a user macro in an item

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 6.2.7
    • None
    • None

       

      I have hosts with items (net.if.in and net.if.out) tagged with:{}

      color = {$MACRO_COLOR}

      The value of {$MACRO_COLOR} is assigned to the host owning the item net.if.in or net.if.out.

       

      Then in a host different host, we have a calculated item that looks like this:

      {{sum(last_foreach(/*/net.if.in[*]?[tag="color:green" and group="MyGroup1"]))}}

       

      This displays the following error:

       

      Cannot evaluate expression: no input data for function at "sum(last_foreach(/*/net.if.in[*]?[tag="color:green" and group="MyGroup1"]))"

       

      HOWEVER

      If I define the tag as:

      color = "green"

      instead of

      color = {$MACRO_COLOR}

      the calculated item works.

       

      According to the documentation, I should be able to use user macros for tag values in items: https://www.zabbix.com/documentation/6.0/en/manual/config/tagging

       

      So I guess that there is a bug evaluating the macros in the item tags.

       

       

       

            ksalins Karlis Salins
            diego-treitos diego-treitos
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: