Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been attempting this for two weeks and I've accessed countless number of sites on this issue and it seems there is something I'm not getting here and I'm at a lost. I manged to figure out how to merge logs from two servers together. (Taking care to only merge the matching domains together)

The logs from the first server span from 15 Dec 2012 to 8 April 2014

The logs from the second server span from 2 Mar 2014 to 9 April 2014

I was able to successfully merge them using the logresolvemerge.pl script simply enermerating each log and > out_putting_it_to_file

Looking at the two logs from each server the format seems exactly the same.

The problem I'm having is producing the stats page for the logs. The command I've boiled it down to is

/usr/share/awstats/tools/awstats_buildstaticpages.pl -configdir=/home/User/Documents/conf/ -config=example.com awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl dir=/home/User/Documents/parced -month=all -year=all -update -buildpdf

In the conf directory I have a filed called: awstats.example.com.conf

 # Name of the logfile
 LogFile=/home/User/Documents/MergedStats/merged_example.com_access_log
 LogType=W
 LogFormat=1
 SiteDomain="example.com"
 HostAliases="REGEX[example\.com$] "
 etc...

Everything Seems in order but the generated stats only show stats from 2 Mar 2014 to 9 April 2014 (The second server's data) I'm not getting the three years data's worth of the first server. At first I thought Awstats was only generating the first month of stats, but the date range is limited to the second server's stats. Even though the merge file contains all of it.

What did I miss?


Update

alxgomz response showed me that the files I wanted were in the dirdata directory I had made. It seems that if you do awstats on a non server it still wants to be served up so I imported those dirdata files to the server however I missing the month of January from the stats. It generated all the way back from 2012 but can't find those records... Could the server maybe not have moved the access logs yet??

Meaning does the main server access_log get parced and spread out to each sub domain by a command or does it Cpanel make all the logs at the same time?

share|improve this question

1 Answer 1

Check your data directory doesn't contain previous data. This would make awstat ignore what he consider as old entries in the log file. Also make sure merging has been done proudly and you don't have logs from your second server at the top of your file (an not sure how awstat would deal with this). Generally speaking if you run awstat.pl instead of its earlier you may have more useful output like reasons why some record have been dropped.

share|improve this answer
    
Does the access_log file have to be sequential? If the logs overlap does the log merge automatically combine them in the right order? ? –  Mallow Apr 17 at 20:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.