Re: Daily Log Audit (regex issue)by jlongino (Parson)
|on Oct 22, 2002 at 04:20 UTC||Need Help??|
I would consider a brute force method to begin with and then refactor from there. Here's where I'd start:
First, you need to decide how to start the processing:
I'd parse the log file line by line and use a hash to keep the necessary info for the jobs in progress:
You examine each line and determine:
Determine your strategy for what happens when you reach EOF:
The regexen used to parse each line should be fairly straight forward, you only have to read the file once, and you keep storage to a minimum. Would this be the most efficient way to do it? I don't know but as I said, during the coding process, you may gain some insight to try something different.