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

possibility to specify several regular expressions in an item

XMLWordPrintable

      Suppose we wish to monitor Web server log files and we have three requirements:

      (1) we do not want to see accesses from our own IPs (e.g., 12.34.56.78, 34.56.78.12, and 56.78.12.34);
      (2) we do not want to see particular domains (e.g., test1.example.com, test2.example.com, and test3.example.com);
      (3) we wish to see lines that contain all of "aaa", "bbb", and "ccc".

      Currently, the only reasonable way to do this is to create a single big regular expression (e.g., MY_BIG_REGEXP) in "Administrator" -> "General" -> "Regular expressions" and then specify this regular expression in an item, like so:

      log[mylogfile.txt,@MY_BIG_REGEXP]

      This sometimes lacks flexibility, which is highly inconvenient. Suppose there is a file hislogfile.txt. We wish to (1) exclude IP addresses 12.34.56.78, 34.56.78.12, and 56.78.12.34 as before, (2) exclude different domains this time: demo1.example.com, demo2.example.com, and demo3.example.com, (3) see lines that contain "aaa", "bbb", and "ccc" as before. And if there is also herlogfile.txt, in which we wish to do (1) and (2) as in the second case, but instead of (3) we wish to see "xxx", "yyy", and "zzz", this leads to three big regular expressions that have a lot of duplicate information.

      What would be highly cool to do, is create five regular expressions:

      (1) NOT_OUR_IPS, which excludes our IP addresses;
      (2) NOT_TEST_DNS, which excludes testX.example.com;
      (3) NOT_DEMO_DNS, which excludes demoX.example.com;
      (4) AAA_BBB_CCC for "aaa", "bbb", and "ccc";
      (5) XXX_YYY_ZZZ for "xxx', "yyy", and "zzz".

      We could then combine them in different ways, like so:

      log[mylogfile.txt,@NOT_OUR_IPS@NOT_TEST_DNS@AAA_BBB_CCC]
      log[hislogfile.txt,@NOT_OUR_IPS@NOT_DEMO_DNS@AAA_BBB_CCC]
      log[herlogfile.txt,@NOT_OUR_IPS@NOT_DEMO_DNS@XXX_YYY_ZZZ]

      This is vastly more flexible and convenient than having to create big regular expressions that have duplicate information. For instance, if we get a new IP address (e.g., 78.12.34.56), we only have to add it to NOT_OUR_IPS, rather than all big regular expressions.

            Unassigned Unassigned
            asaveljevs Aleksandrs Saveljevs
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: