#131 Multiple Patches to Awstats for consideration


A new fan to AWstats and I must say it is a great program! I run it in an organisation with extremely large web log files, for numerous domains, and management want as much stats as possible - including stats by day.

I've made some changes to awstats (all changes relate to awstats 6.6 release) iself to add some extra features, and provided a couple of extra tools which may be helpful to people who wish to get monthly and daily stats for each site or have large files where reverse dns lookups are not an option. Some of the changes should perhaps be plugins but I don't think that any of the changes affect the default behavoir of awstats and (hopefully) do not break any of the standard features. Each change is clearly labled (search for davidm).

To awstats.pl
minor - change statistics for box to display siteconfig and not sitedomain, more useful for multiple configs for the same www.domain.
daily stats - when awstats dailyformat databases are available, a day selector is added to the form at top of page - otherwise the usual month and year are the only options present.
daily stats do not require a separate config file.
When viewing a daily stats database, ShowMonthStats, ShowDaysOfMonthStats and ShowDaysOfWeekStats are automatically disabled (as they have no relevance anyway!)
When selecting a day via the menu or cgi, DatabaseBreak=day is automatically set.
Allow input of logfile via stdin with -logfile=stdin parameter. This is useful with my updated awstats_updateall_monthandday.pl script as I stream the output of logrresolvemerge.pl to several awstats processes at the same time to do month and day (with large logs we don't want to have to run the logs multiple times).
Day and month selectors in menu form do not display months or days where awstats databases do not exist.
Summary will print the day if day report selected.
* When drawing the hosts table awstats will lookup host names from a .hosts file if it exists matching the awstats database name. A separate perl prog is provided that creates the hosts files from awstats databases.

Tools: -
reverselookups.pl - Find awstats databases, if modified in the last two days, rebuild a coresponding .hosts file for the top 25 hosts. For those of us who can't use reverse lookups for our entire logs being too large. This util requires Tie::DNS and Net::DNS.

awstats_updateall_monthandday.pl - quite a few changes to make this program update monthly and daily stats for each config at the same time. This version requires logresolvemerge and a separate util multipipe.pl. The logfile parameter is extracted from each config file, logresolvemerge is run and its output streamed to two awstats processes, one for month stats and one for day.

multipipe.pl - simple program to take a stream of input from STDIN and stream it to several other programs at the same time - kinda like tee, but do as many as you like. This is required to be able to have several awstats processes are sharing the same stream of log file. Where your log files are very large, you can not afford to run through them multiple times.

I've submitted these changes in the hope that someone else might find them useful; they acheive what I need from the present awstats, but might not be suitable for future versions.




  • Dave McCormick (IG INDEX)

    Logged In: YES
    Originator: YES

    Sorry, there was a bug in my patched awstats.pl which was not correctly looking up day databases 01,02,03,04 etc.. and so not displaying the day selector until day data was available from the 10th of the month and beyond! I've uploaded a new version of awstats which corrects this issue.


    File Added: awstats.pl.gz

  • Dave McCormick (IG INDEX)

    Updated awstats.pl


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks