Support of regsub() for LLD macros

XMLWordPrintable

    • Type: Change Request
    • Resolution: Fixed
    • Priority: Trivial
    • 4.0.0beta1, 4.0 (plan)
    • Affects Version/s: None
    • Component/s: Server (S)
    • None
    • Sprint 37, Sprint 38, Sprint 39, Sprint 40, Sprint 41
    • 3

      Zabbix must support regsub() and iregsub() functions for LLD macros. It will allow to extract certain parts of LLD macro using regular expression. The functions will be supported in all locations allowed for LLD macros.

      A typical use case

      A LLD macro contains customer name and network interface number:

      {#IFALIAS}=customername_1

      I want to extract and use customer name and interface number in trigger tags "Customer" and "IF", therefore I take advantage of the function regsub():

      Customer: {{#IFALIAS}.regsub("(.*)_([0-9]+)", \1)}
      IF: {{#IFALIAS}.regsub("(.*)_([0-9]+)", \2)}

            Assignee:
            Viktors Tjarve
            Reporter:
            Rostislav Palivoda (Inactive)
            Team A
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: