You might want to check out Lincoln Stein's home page. He's got a section called Cute Tricks with Perl and Apache. It talks a lot about parsing log files and it even gives some tips on regexes for parsing them
You also may want to check out Akira Hangai's Apache::ParseLog. It uses pre-complied regex's and there are a bunch of methods to get at your data.