• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6343
  • Last Modified:

Custom AWSTATS log format for IIS and running existing logs in batch

Hi
Can anyone help me to create a custome log file for IIS logs that were captured in the following format:

#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2006-11-23 11:16:09
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2006-11-23 11:16:09 W3SVC463436271 196.2.xx.xxGET /index.asp - 80 - 217.31.169.71 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+95) 200 0 0
2006-11-23 11:16:09 W3SVC463436271 196.2.xx.xx GET /styles.css - 80 - 217.31.169.71 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+95) 200 0 0
2006-11-23 11:16:09 W3SVC463436271 196.2.xx.xx GET /header.asp - 80 - 217.31.169.71 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+95) 200 0 0
2006-11-23 11:16:11 W3SVC463436271 196.2.xx.xx GET /home.asp - 80 - 217.31.169.71 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+95) 200 0 0
2006-11-23 11:16:11 W3SVC463436271 196.2.xx.xx GET /nav.asp - 80 - 217.31.169.71 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+95) 200 0 0
2006-11-23 11:16:11 W3SVC463436271 196.2.xx.xx GET /footer.asp - 80 - 217.31.169.71 Mozilla/4.0+(compatible;+MSIE+5.5;+Windows+95) 200 0 0

I also need help with running awstats on all the log files for a couple of months.

I have a folder with the last 4 or so month's worth of daily stats in exYYMMDD.log format

I tried running awstats by changing the config file for awstats for the particular domain to just point to "/path/to/logs/ex*.log", but that doesn't work. Only when I explicitly mention a file in the path does awstats run ( but then it complains about the missing fields in the log files - hence my question about telling awstats to use the existing log formats as per example above).
0
psimation
Asked:
psimation
1 Solution
 
mrcoffee365Commented:
AWStats does not read the default IIS log format without some configuration.  Put the following Log format in your awstats awstats.model.conf file:

# Use this LogFormat for limited IIS log (default log format from IIS 6)
LogFormat="date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-bytes"

Don't put line break in.

A format like this works well for IIS logs:
LogFile="C:/WINNT/system32/LogFiles/W3SVC3/ex%YY-24%MM-24%DD-24.log"

When you run awstats, you can also specify which file you want it to run on (as long as it is where you specified for the LogFile location above):

perl c:\awstats-6.5\wwwroot\cgi-bin\awstats.pl -config=mymodel  -LogFile="C:/WINNT/system32/LogFiles/W3SVC3/ex061123.log" -update

Again, no line breaks.



 
0
 
psimationAuthor Commented:
Hi Mrcoffee365

Thx alot for that, the first part should definately work.

However, do you perhaps know how I can modify the .conf fil to include ALL the log files I already have on file?
I'd hate to have to run that command 180 time manually ( I've basically got 180 days worth of log files that I need AWSTATS to process...)
0
 
mrcoffee365Commented:
I don't think there's an AWStats way to run it against multiple files at once.  You can write a script file which creates each log file name.  Or cut and paste the lines into a big .bat file.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
npglobalCommented:
I am running IIS log with the following formats

#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status

and i unable to run this.. please help me out to sort out this problem
0
 
mrcoffee365Commented:
You need to open a new question, not ask your question as part of an already answered question.

http://www.experts-exchange.com/Web_Development/WebTrends_Stats/
0
 
dolharzCommented:
> However, do you perhaps know how I can modify the .conf fil to include ALL the log files I already have on file?

To perform a wildcard analysis of multiple-file log, set the LogFile to this:

LogFile="e:\awstats\tools\logresolvemerge.pl C:/WINNT/system32/LogFiles/W3SVC3\*.log |"

Change the  path to AWstats correctly.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now