In message <[EMAIL PROTECTED]>,
Tim Peiffer writes:

>I am using the PairWithWindow to parse and act on peering logs.  The 
>logs are indicating syntax errors coming from the perl minicode used for 
>checking context.  If this is truely perl, then why wouldn't   /pattern/ 
>be a legal construct?  Do I need to wrap the context definition =($3 =~ 
>/pattern/) in braces? eg ({$3 =~ /pattern/; }) ?

I think you need $3 in quotes. But it's difficult to tell without the
real error message. I assume the <Peer DNS> below is a replacement
token and not the real value of $3.
>
>Thu Aug 28 14:23:08 2008: BGP Peer Down  Severity: Critical Source: <BGP 
>Host> (<Peer IP> / <Peer DNS>.) Details:
>Thu Aug 28 14:23:08 2008: Error evaluating code '<Peer DNS> =~ 
>/<provider1>|<provider2>/i': syntax error at (eval 64) line 1, near ". =~"

Looks like this could evalute to:

   192.168.3.5. =~ /192.168.3.5|192.168.3.6/

which evals as:

perl -e 'print "yes\n" if 192.168.3.5. =~ /192.168.3.5|192.168.3.6/;'
  syntax error at -e line 1, near ". =~"
  Execution of -e aborted due to compilation errors

looks somewhat familiar.
However:

perl -e 'print "yes\n" if "192.168.3.5." =~ /192.168.3.5|192.168.3.6/;'
yes

works.

># Use the augmented event above as part of the pair.
>#
># Commercial peers have a higer availability expectation.  I am 
>expecting them
># to be down for less than a minute or notify
>#
>type=PairWithWindow
>ptype=RegExp
>pattern=BGP Peer Down\s+Severity: \S+ Source: (\S+) \((\S+) \/ (\S+)\) 
>Details: (.*)
>desc=FEED BGP Peer Down $1 to $3
>context= =($3 =~ /<provider1>|<provider2>/i)
>action=logonly %s sending page ; \
>    pipe 'BGP Peer down $1 to $2/$3' /usr/bin/mail <page destination>
>ptype2=RegExp
>pattern2=BGP Peer Established Severity: \S+ Source: (\S+) \(peer to 
>(\S+)\) Details: (.*)
>desc2=FEED BGP Peer bounced link $1 to $2
>action2=logonly %s
>window=60

--
                                -- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to