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

Item that matches pattern in string and extracts a portion of the data using regex

    XMLWordPrintable

    Details

    • Type: Change Request
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: Agent (G)
    • Labels:

      Description

      A new Item type called "vfs.file.regextract" that would allow you to match on a string and then extract and return only a portion of data from within that string would be very useful.

      Using as an example, the following log entries:
      timestamp: Process (1811) wrote 30894 rows
      timestamp: Process (1854) wrote 45354 rows

      It would be cool if you could create an Item like this:

      vfs.file.regextract[/logs/row-data.log,"wrote (\d+) rows", 1]

      would result in this data:
      1st match: 30894
      2nd match: 45354

      Item definition:

      vfs.file.regextract[<path to file>, <regex pattern to match>, <number of lines to read>]

      Like with perl regex pattern matching and extraction, the parenthesis indicate the portion of data to extract.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              kodai Kodai Terashima
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: