Hello everyone,

I need some help to fix a problem in mailgraph.pl script. I'm not a perl programmer, so i hope to find a little help here...

I need to translate an old code which is parsing my maillog file, into new one, related to my present needs.

The old code has worked with old vexira logging style (now deprecated).... Lines in my maillog was something like:

Aug  7 13:40:28 pharma vgatefwd[1532]: VIRUS bla bla bla

Here comes old code:
       elsif($prog eq 'vagatefwd') {
               # Vexira antivirus
               if($text =~ /^VIRUS/) {
                       event($time, 'virus');
               }
       }

The new code (rewrited by me), should work with new vexira logging style... lines in my maillog as following:

Aug 7 13:40:28 pharma hook[2446]: ***** Virus (I-Worm.Netsky.Q1) killed with file delete!

Here come the new code....
       elsif($prog eq 'hook') {
               # Vexira antivirus
               if($text =~ /^\([\*]+\) Virus\b/) {
                       event($time, 'virus');
               }
       }

Is my new code correct? If no, how should it be?

Regards,
Alex



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to