Xymon Mailing List Archive search

How to search "error." pattern with LOG

4 messages in this thread

list Vincent Schultz · Fri, 19 Dec 2008 16:17:55 +0100 ·
Hello,

I am trying to monitor a log file in order to be alerted when the string 
"error." appears.

For instance :

error.grammar
error.noressource

... should send an alert

but "error " (with a space after) should not.

I tried to put in hobbit-clients.cfg :

LOG     /tmp/log error. COLOR=yellow
==> does not work

LOG     /tmp/log %(?-i)error. COLOR=yellow
==> works but match with error (without the .)

Does anyone can help me to find the correct regexp please ?

Thank you,

Vincent
list Asif Iqbal · Fri, 19 Dec 2008 10:44:38 -0500 ·
quoted from Vincent Schultz
On Fri, Dec 19, 2008 at 10:17 AM, Vincent Schultz <user-c08270e43333@xymon.invalid> wrote:
Hello,

I am trying to monitor a log file in order to be alerted when the string
"error." appears.

For instance :

error.grammar
error.noressource

... should send an alert

but "error " (with a space after) should not.

I tried to put in hobbit-clients.cfg :

LOG     /tmp/log error. COLOR=yellow
==> does not work

LOG     /tmp/log %(?-i)error. COLOR=yellow
==> works but match with error (without the .)
`.' includes space as well.
Try something like %error\..  (untested)
quoted from Vincent Schultz
Does anyone can help me to find the correct regexp please ?

Thank you,

Vincent

-- 

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
list Thomas R. Brand · Fri, 19 Dec 2008 10:48:45 -0500 ·
quoted from Asif Iqbal
 
I am trying to monitor a log file in order to be alerted when the
string
"error." appears.

For instance :

error.grammar
error.noressource

... should send an alert

but "error " (with a space after) should not.
The '.' in your expression matches 'any character', not the characteter
'.'
You need to 'escape' (precede it with a '\' it to force it to mean the
actual character '.'

Try using
	LOG     /tmp/log "%error\." COLOR=yellow
list Henrik Størner · Fri, 19 Dec 2008 15:49:01 +0000 (UTC) ·
quoted from Vincent Schultz
In <user-3f5b11d0ef2b@xymon.invalid> Vincent Schultz <user-c08270e43333@xymon.invalid> writes:
I am trying to monitor a log file in order to be alerted when the string 
"error." appears.
LOG     /tmp/log error. COLOR=yellow
==> does not work
Does anyone can help me to find the correct regexp please ?

How about
	LOG /var/log/YOURLOGFILENAME error\.


Regards,
Henrik