We've recently started using Awstats to analyse logfiles on our clustered servers. All is working fine except when the merged log file from the 2 servers is created using the logresolve tool I have to paste the following at the top of the merged log file for Awstats to proces the log:
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Fields: date time cs-method cs-uri-stem cs-uri-query cs-username c-ip cs-version cs(User-Agent) cs(Referer) sc-status sc-bytes
This means that I cannot set up a scheduled task to run the job automatically, which is a shame!
With the short form of the LogFormat, AWStats has to search for a format specification within the input file; it could be that logresolve removes this format specification.
Which is the format the logfiles are saved in. When I run Awstats now, it parses without error but doesn't produce any results when I creat a report. So I no longer need to paste that text into the top of the combined logfile like I did, which is great, but now I get no figures…confused?….oh yes!
This LogFormat does not match the fields specification in your first post:
#Fields: date time cs-method cs-uri-stem cs-uri-query cs-username c-ip cs-version cs(User-Agent) cs(Referer) sc-status sc-bytes
For example, according to your first post, the field after the date and time is cs-method which AWStats calls %method.
Did you try the LogFormat I suggested ?
At the end of the database update, AWStats prints a report like this one:
Create/Update database for config "/path_to_awstats/awstats.my_domainconf" by AWStats version 6.7 (build 1.892)
From data in log file "/path_to_log_file/log_file_name"…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 3693
Found 520 dropped records,
Found 12 corrupted records,
Found 0 old records,
Found 3161 new qualified records.
This information helps understand what happened when there is a problem.
Thank you! I used the logformat from the boxes ticked on the IIS settings rather than the format I originally posted. I've now used your suggestion and the files are parsed without a problem.
Cheers for your help!
One last question!
Now I want to automate the process using a scheduled task. I can set up a btach file with my Awstat commands and get the scheduled task to run but it seems logresolve doesn't like the format D:/LogFiles/W3SVC1725568973/ex%YY-0%MM-0%DD-24 to merge yesterday's file. It works if I specify the exacy logfile name e.g. ex071108.log.
It's getting clear ! The point is that logresolvemerge.pl is not processing file names like awstats.pl does.
You cannot use these %YY-xx%MM-xx%DD-xx with logresolvemerge.pl. I am afraid you will have to use tricks around the DATE function in the batch file to automate things as you want.
Also note that %YY-0%MM-0%DD-24 is not going to do what you expect. On January 1, 2008, %YY-0%MM-0%DD-24 will return 080131. You should use %YY-24%MM-24%DD-24 that would return 071231.