in reply to Monk Specs.?
I'm going to post a snip of the main loop for my Arcserve parser, mostly because I catch some of the weird things that pop up in our logs. Errors that start on a seperate line is one that tripped me up bad. These might help you if you run into them in your logs:
#%jobentry is defined outside of the while loop while (<LOG>) { next if /^\n/; my %line; my ($date, $time, $jobinfo, $jobtext); chomp; if (/^(E\d{4})/){ $jobtext .= "[$1] "; $_ = substr $_, 6; }elsif (!/^\d{8}/){ my $tmp_count = $count - 1; $job_entry[$tmp_count]{'text'} .= $_; next; } $date = substr $_, 0, 8; $time = substr $_, 9, 6; $jobinfo = substr $_, 16, 6; $jobtext .= substr $_, 23; #o_trim is a little sub for taking out any straggling whitespace in th +e job description $jobinfo = o_trim($jobinfo); #Go on with rest of loop. I push the data into a hash, and then push t +he hash into a database structure after I gather an entire job's wort +h of entries. }
The entire code is tested and works, if quite quirky, as I was playing with some ideas about data structures when I did it. I'll post it if there is any interest.
----Asim, known to some as Woodrow.
|
---|