Forum Moderators: DixonJones

Message Too Old, No Replies

Personalized Apache Log Format Issue For AWStats

         

nowisthetime

9:01 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



Hello Everyone at Webmaster World.

I am having an problem configuring the AWStats Conf file to match my apache log. This is how everything is set up.

1. I am running Cygwin on a windows 2K box and have AWStats running under Cygwin. I download my apache log files to my box everyday and "try" to run AWStats.

This is how the log file directive is set up.

"%{%a %b %e %H:%M:%S %Y}t %T %h %b %f %u"

And here is a sample of the output in our log file. The host IP address is fake.

Wed Jun 1 00:15:58 2005 5 111.111.111.1 95545 /A/Product/On/Our/Site/cool.gif -

I have checked all the directives against Apaches website and this is what I "think" should be in my AWStats conf file.

%time3 %other %host %bytesd %url %logname

Now when I go to run AWStats, I am returned with this error.

"Error: Your personalized LogFormat does not include all fields required by AWStats (Add %methodurl or %method in your LogFormat string).
Setup ('./awstats.XXXX.conf' file, web server or permissions) may be wrong. Check config file, permissions and AWStats documentation (in 'docs' directory)."

I have replaced %url with %methodurl and %method but with no such luck. I do not understand why AWStats is wants me to use the %methodurl or %method when we are not even logging those paramaters.

A co-worker mentioned it might have to do with the time format so made a new log file with the time stamp removed and AWStats complained about a time stamp.

Any and all help will be greatly appreciated.

One more thing...
1. The log format cannot be changed. Someone way above me wants it that way.

Ryan

nowisthetime

7:44 pm on Jun 6, 2005 (gmt 0)

10+ Year Member



Can anyone help me out? Any suggestions welcomed....
Ryan

gregbo

5:22 am on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible for you to capture the logs and convert them to a format awstats understands before they're passed to awstats? It looks to me as if the first five entries are a Unix date without the timezone, and the next to last entry is the URL without the method or the HTTP version. So if you could capture the logs and write something like a Perl script that would insert appropriately formatted fields, you could pass the results to awstats. (This assumes that all of the input records are correctly formatted and that you are willing to live with the fact that whatever the original fields were that were passed to your web server via HTTP have been replaced with the formatted fields that make awstats happy.)

As a general principle, I would recommend having a meeting with whoever is responsible for generation of the logs, and finding out why they can't be generated in one of the standard formats. If possible, have someone who is responsible for business decisions present at the meeting. You will have much more leverage if you can impress upon the person who is responsible for generation of the logs the financial importance of generating logs that are compliant with standard log analysis software.