Hi guys,
I need to monitor some logs from a meassurement software with Zabbix 1.6.7 (upgrade to new version will be next month). A log-file (/var/test.txt) looks like this:
entry1: 123
entry2: 456
entry3: 789
...
This file always have the same entries but the values changes everytime the log-file is updated. I need to get the value of every entry.
I created an item in Zabbix with the key log[/var/test.txt,"entry1:"] which generates an output of "entry1: 123" (exactly like it is written in the log). Zabbix returns the right entry from the log but the output should only contain "123" without the leading "entry1: " string. I tried to add a regex in the key but I can't find the right regex for my problem.
I tried many many regex with egrep under linux without any success. I do not know much about regex at all, so it's quite possible that I'm doing it completely wrong
example (doesn't work):
egrep 'entry1:[[:space:]][[:digit:]]' /var/test.txt
I also tried the ( ) and \1 which doesn't work, too.
egrep 'entry1[[:space:]][([:digit:])\1]' /var/test.txt
Can someone help me? That would be great!
Thanks!!!
I need to monitor some logs from a meassurement software with Zabbix 1.6.7 (upgrade to new version will be next month). A log-file (/var/test.txt) looks like this:
entry1: 123
entry2: 456
entry3: 789
...
This file always have the same entries but the values changes everytime the log-file is updated. I need to get the value of every entry.
I created an item in Zabbix with the key log[/var/test.txt,"entry1:"] which generates an output of "entry1: 123" (exactly like it is written in the log). Zabbix returns the right entry from the log but the output should only contain "123" without the leading "entry1: " string. I tried to add a regex in the key but I can't find the right regex for my problem.
I tried many many regex with egrep under linux without any success. I do not know much about regex at all, so it's quite possible that I'm doing it completely wrong

example (doesn't work):
egrep 'entry1:[[:space:]][[:digit:]]' /var/test.txt
I also tried the ( ) and \1 which doesn't work, too.
egrep 'entry1[[:space:]][([:digit:])\1]' /var/test.txt
Can someone help me? That would be great!
Thanks!!!
Comment