Anyone have suggestions on how to tackle something like this? i tried to reads with an unless MAIL From but that doesn't solve the problem of overlap. This is what I have been playing with:Connection from 111.222.333.444, Mon Feb 12 08:53:27 2001 EHLO mhub6.tc.umn.edu MAIL FROM:<user1@myotherhost.mydomain.net> RCPT TO:<user2@myhost.mydomain.net> DATA - 1216 lines, 83052 bytes. Connection from 64.4.15.226, Mon Feb 12 08:53:34 2001 EHLO hotmail.com MAIL FROM:<paica@hotmail.com> RCPT TO:<user4@myhost.mydomain.net> DATA - 29 lines, 1215 bytes. QUIT - 1 sec. elapsed, connection closed Mon Feb 12 08:53:36 2001 QUIT - 19 sec. elapsed, connection closed Mon Feb 12 08:53:46 2001 Connection from 208.1.71.165, Mon Feb 12 08:54:01 2001 Connection from 208.1.71.165, Mon Feb 12 08:54:01 2001 Connection from 208.1.71.165, Mon Feb 12 08:54:01 2001 EHLO ancmail02.ancestry.com MAIL FROM:<Reminder@MyFamilyInc.com> MAIL FROM:<Reminder@MyFamilyInc.com> MAIL FROM:<Reminder@MyFamilyInc.com> RCPT TO:<user3@myhost.mydomain.net> RCPT TO:<user3@myhost.mydomain.net> DATA - 249 lines, 14229 bytes. DATA - 217 lines, 12388 bytes. DATA - 217 lines, 12403 bytes. QUIT - 2 sec. elapsed, connection closed Mon Feb 12 08:54:03 2001 QUIT - 2 sec. elapsed, connection closed Mon Feb 12 08:54:03 2001 QUIT - 2 sec. elapsed, connection closed Mon Feb 12 08:54:03 2001
I'm a newbie, be gentle.sub ParseIt { my $text = ''; open (MERLOG,$log) || die "Unable to open $log:$!\n"; while (<MERLOG>) { unless (/MAIL From.*?\n/smi) { # Continuation of record in progress $text .= $_; } else { # Found a new record examine_record($text); # $text = $_; } } # caveat for the last record because it will not be followed b +y a new record examine_record($text); }
Edit: 2001-03-05 chipmunk
In reply to Parsing MercuryMail logs by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |