The article on Solution Expert Online Blogs gives a great tip on using Awstats for the CloudFront logs. Unfortunately, the suggested change of LogFormat parameter was a good start but wasn’t really working. I’ve found few more issues that had to be fixed:
- Log separator is the tab character, not space.
- The first tab separates date and time and had to be converted to space in order to be accepted by Awstats as a single field.
- Awstats will drop log records if site name doesn’t mach those in your log files.
Here arethe changes I made in my awstats.config to make it work:
LogFile="/path_to/logresolvemerge.pl /path_to/logs/cloudfront_logs/* | sed 's/\t/ /' $ LogFormat="%time2 %cluster %bytesd %host %method %virtualname %url %code %referer %ua" LogSeparator="\t" SiteDomain="public.site-domain.com" HostAliases="REGEX[.cloudfront\.net]"
Hope this helps!
Using Java? Speed-up bug fixing and improve customer satisfaction using LogDigger to create detailed error reports and notifications for your web application
{ 1 comment… read it below or add one }
Thank you so much! I was having this same problem and was really struggling to figure it out! They should add these instructions to the tutorial on the AWS site, I’m sure others have the same problem.