Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-4627

Support of regsub() for LLD macros

    XMLWordPrintable

    Details

    • Type: Change Request
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0beta1, 4.0 (plan)
    • Component/s: Server (S)
    • Labels:
      None
    • Team:
      Team A
    • Sprint:
      Sprint 37, Sprint 38, Sprint 39, Sprint 40, Sprint 41
    • Story Points:
      3

      Description

      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)}

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              viktors.tjarve Viktors Tjarve
              Reporter:
              palivoda Rostislav Palivoda
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: