[ZBXNEXT-1489] Item that matches pattern in string and extracts a portion of the data using regex Created: 2012 Oct 29  Updated: 2013 May 07  Resolved: 2013 May 07

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G)
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Change Request Priority: Minor
Reporter: Kodai Terashima Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: regexps
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-1653 Add an agent item to extract matching... Closed

 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.



 Comments   
Comment by richlv [ 2012 Oct 29 ]

very similar to ZBXNEXT-1427 (it's about log monitoring, this is about whole file contents)

Comment by Oleksii Zagorskyi [ 2012 Oct 30 ]

Another feature could help (I hope) to reach desired results - ZBXNEXT-1443

Comment by Kodai Terashima [ 2013 May 07 ]

implemented under ZBXNEXT-1653

Generated at Fri Apr 26 07:28:57 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.