Given what you need to do, I think you may find you're better off separating the log parsing and data analysis phases. Have one program who's sole function is to parse the log files and dump the results into a database, and a second to process the data in that database. (You could alter the system to log directly to a DB rather than a file, but I wouldn't recommend that for reliability reasons)
It'll make your life a lot easier in the long run, and give you access to more sophisticated data analysis tools. Setting up MySQL or Postgres isn't that big a deal--I'd really recommend you give it a shot this way.