Xymon Mailing List Archive search

Question for regular expression in hobbit-alerts.cfg

2 messages in this thread

list T.J. Yang · Mon, 23 Jul 2007 16:27:43 -0500 ·
I have a rule trying to catch name name like
ra1234.mywork.com, ratest.mywork.com etc.

So I written down as "ra.*.mywork.com" in hobbit-alerts.cfg file.

but turns out it also catch "sdultra72.mywork.com" type of hostname.

currently the pattern is changed to "^ra.*.mywork.com" so "sdultr72.mywork.com" won't be matched.

Question is do I have change my other hostname pattern to start with ^  (1st character started with )  symbol  ? , Just to be on safe side ?


T.J. Yang

Need a brain boost? Recharge with a stimulating game. Play now!� http://club.live.com/home.aspx?icid=club_hotmailtextlink1
list Henrik Størner · Mon, 23 Jul 2007 23:35:08 +0200 ·
quoted from T.J. Yang
On Mon, Jul 23, 2007 at 04:27:43PM -0500, T.J. Yang wrote:
I written down as "ra.*.mywork.com" in hobbit-alerts.cfg file.
but turns out it also catch "sdultra72.mywork.com" type of hostname.

currently the pattern is changed to "^ra.*.mywork.com" so "sdultr72.mywork.com" won't be matched.

Question is do I have change my other hostname pattern to start with ^  (1st character started with )  symbol  ? , Just to be on safe side ?
If You expect the patterns should match from the beginning of the hostname,
then adding the anchor is the safest way to achieve that.


Regards,
Henrik