Thanks Aengus,
this looks like the sort of thing I want. The reason I want to do this is
that we are having our website audited next month, and I need to produce, in
addition to the raw logfiles which I analyse, a filtered logfile containing
only the lines which I am telling Analog to include. I'm using Windows NT
and IIS version 4, so I'll have a go with your script.

Thanks again,
Phil.

----- Original Message -----
From: Aengus Lawlor <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 17, 2000 4:27 PM
Subject: Re: [analog-help] Pre-processing logfiles


> Philip Harper wrote:
>
> >Does anyone know a way of pre-processing a logfile, in order to create a
new
> >logfile containing only the lines you wish Analog to include in a report.
> >Or is there anyway of getting Analog to write each line that it counts to
a
> >new logfile whilst its producing the report. Hence, creating a results
> >logfile.
>
> What platform are you on, and what sort of filtering do you want to do?
>
> I use the following batchfile to create XYZ.LOG from my daily IIS logs,
> where  XYZ is a folder or subweb of the server (in other words, I create
> a separate log file containing just the requests for pages in
> http://server/XYZ/ )
>
>
> @echo off
> echo #Date: > headers.txt
> echo #Fields: >> headers.txt
> echo #Software: Microsoft Internet Information Server 4.0 > %1_APR.log
> for /l %%f in (401,1,430) do
>    findstr /i /c:" /%1/" /g:headers.txt ex000%%f.log >> %1_Apr.log
> del headers.txt
>
> Note that the FOR ... FINDSTR command should be all on one line - I
> broke it after the DO to aid readability
>
> The FOR and FINDSTR commands may need some explanation:
>
> FOR /L will loop through the numbers indicated -
> FOR /L %f in (start, step, end) do ...
>
> so  "for /l %%f in (401,1,430) do " will give %f the value 401, 402,
> 403, 404, etc, repeating the command in the DO clause until the loop
> exits at 430. (Note that the use of % signs within batch files can be
> confusing).
>
> FINDSTR /i /c:" /XYZ/" g:headers.txt ex000401.log  will search
> ex000401.log for all lines that have either " /XYZ/" or "#Date" or
> "#Fields"  (these entries are stored in headers.txt)
>
>
> This batchfile will go through my daily logs (for April, in this case)
> and create a single logfile containing only requests for a particular
> folder, and any Extended header log files that are generated during the
> month (in case of a change of log format). The "#Software:" header is
> added automatically at the start of the new log file.
>
> Aengus
> ------------------------------------------------------------------------
> This is the analog-help mailing list. To unsubscribe from this
> mailing list, send mail to [EMAIL PROTECTED]
> with "unsubscribe" in the main BODY OF THE MESSAGE.
> List archived at http://www.mail-archive.com/[email protected]/
> ------------------------------------------------------------------------


------------------------------------------------------------------------
This is the analog-help mailing list. To unsubscribe from this
mailing list, send mail to [EMAIL PROTECTED]
with "unsubscribe" in the main BODY OF THE MESSAGE.
List archived at http://www.mail-archive.com/[email protected]/
------------------------------------------------------------------------

Reply via email to