procmail
[Top] [All Lists]

extract number out of body and do condition on it

2001-07-03 09:37:30
hi

When a particular mail message comes thru with this in the body:


Alert        15.222 secs

I would like to be able to grab the "15" portion - and see if it's
greater than 40.  If the number is greater than 40 - I would then like
to send the mail message to someone.

--------------------------------------------------------------
:0
* ^From(_dot_)someone(_at_)somewhere
* ^Subject:.Alert Message
{
        :0 Bc
        *Server down alarm|100\.000\%
        ! someone(_at_)somewhere
        :0 Ac
        in-testing
*******EVERYTHING ABOVE WORKS OK*******************
*******BELOW IS WHERE I NEED HELP*********************
        :0 Bc
        * ^Alert \/(\d+)

I'm not sure what to do?  I THINK that the above line says - if a line
begins with "Alert" in the body of the message - take the next number
and place it in $MATCH   (???maybe????)

Can someone help?

How do I grab the number - compare it to another number - and if A is
greater than B - mail the message??

thanks
jill



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail