Forum: How to change the log file naming format

 

« Back To Thread List

procca
3615 days ago
My isp provides a log file that I cannot change the name of. Format is log.yyyymm. How do I change the config of Jawstats to look for the correct file? Currently, that is the only thing I don't think is configurable.
joncombe
3614 days ago
Are you sure the log file in this instance is created by AWStats? It sounds to me as if you are looking at the raw log created by your web server. You are free to email the file so I can check if you aren't sure. jon@jaw....
joncombe
3614 days ago
...and apologies if you are sure and I'm making false assumptions. :)
procca
3608 days ago
First, I don't see a flag in awstats to have a single digit for the month number. Secondly, here are the instructions my ISP provides for installing awstats. Thanks for your help.

How do I install AWStats?
To install AWStats to your Netfirms hosting account, please follow these steps:

I. Install and Configure AWSTATS

1. Download AWStats from http://awstats.sourceforge.net/ (current file is awstats-6.5zip)
2. Unzip the file to your local computer (a number of folders will be created)
3. Using an FTP client (eg. Filezilla) or Netfirms File Manager, create a folder in your www directory of your web account called "awstats" (/www/awstats)
4. From the awstats file you unzipped in step 2 copy the "js", "classes", "css" and "icon" folders (located in the wwwroot folder) to the "/www/awstats" folder you just created in your website directory.
5. From the awstats file you unzipped in step 2 copy the contents of the "cgi-bin" folder into your cgi-bin website directory.
6. Edit the awstats.model.conf file and change the following parameters:

LogFile = "../www/log.%YYYY%MM" (assuming your log files are being placed in the www root directory).
SiteDomain = "www.yourdomain.com"
DirIcons = "http://www.yourdomain.com/awstats/icon"
AllowToUpdateStatsFromBrowser = 1

7. Copy the new awstats.model.conf file to the cgi-bin directory (overwriting the default one).

II. Enable Logging On Your Account:

1. Login to the Netfirms Members Control Panel at https://controlpanel.netfirms.com
2. Click Site Tools
3. Under the Statistics section, click Log Files
4. Enter a directory where you would like your website's log file to be downloaded to
(NOTE: The log file must be stored somewhere within the /www folder)
5. Click Enable

To access your website's raw log files, connect to your hosting account with either Netfirms File Manager in the Control Panel or use an FTP client (eg. Filezilla).
For more information about AWstats (eg. screenshots, stats compiled, etc.), please visit their website at: http://www.awstats.org/

III. Access AWSTATS

8. You can access them here: http://www.yourdomain.com/cgi-bin/awstats.pl?config=model OR if your domain is being forwarded then please access your stats at (where membername is the Netfirms member name assigned to your Netfirms hosting account): http://membername.netfirms.com/cgi-bin/awstats.pl?config=model

IV. Update AWSTATS

There are 3 ways to update your AWSTATS:

(a) Web Browser method (not recommended for busy sites):

(i) Browse to http://www.yourdomain.com/cgi-bin/awstats.pl?config=model OR if your domain is being forwarded then please access your stats at (where membername is the Netfirms member name assigned to your Netfirms hosting account): http://membername.netfirms.com/cgi-bin/awstats.pl?config=model
(ii) Click the "Update Now" link to process your log files each time you access the stats.

(b) CRON method (recommended for busy sites):

If your hosting plan supports Cron (Scheduled tasks), click here for setting up a cron job to automatically update your AWSTATS.

(c) Command line via SSH method:

If your hosting plan supports SSH, click here for instructions on how to access your account via SSH. Once connected to your account via SSH, the command line to use to update AWSTATS is:
/usr/local/nf/bin/perl ../cgi-bin/awstats.pl -config=model -update

For more support on Awstats, please refer to support documentation at http://awstats.sourceforge.net/docs/awstats_faq.html
joncombe
3607 days ago
Procca,

I still think you may be confused between the log files generated by your web server and the data files generated by AWStats. JAWStats relies on the data files generated by AWStats.

Have a look in the awstats.model.conf file described above and look for a setting called: DirData. This is the path to the files JAWStats needs.

Please let me know how you get on.
procca
3600 days ago
Here's an excerpt from the config file. Even AWSTATS' own documentation does not allow for a single digit month. I'm able to use AWSTATS no problem. I find the Jawstats documentation on the input file naming to be lacking clarity.

#-----------------------------------------------------------------------------
# MAIN SETUP SECTION (Required to make AWStats work)
#-----------------------------------------------------------------------------

# "LogFile" contains the web, ftp or mail server log file to analyze.
# Possible values: A full path, or a relative path from awstats.pl directory.
# Example: "/var/log/apache/access.log"
# Example: "../logs/mycombinedlog.log"
# You can also use tags in this filename if you need a dynamic file name
# depending on date or time (Replacement is made by AWStats at the beginning
# of its execution). This is available tags :
# %YYYY-n is replaced with 4 digits year we were n hours ago
# %YY-n is replaced with 2 digits year we were n hours ago
# %MM-n is replaced with 2 digits month we were n hours ago
# %MO-n is replaced with 3 letters month we were n hours ago
# %DD-n is replaced with day we were n hours ago
# %HH-n is replaced with hour we were n hours ago
# %NS-n is replaced with number of seconds at 00:00 since 1970
# %WM-n is replaced with the week number in month (1-5)
# %Wm-n is replaced with the week number in month (0-4)
# %WY-n is replaced with the week number in year (01-52)
# %Wy-n is replaced with the week number in year (00-51)
# %DW-n is replaced with the day number in week (1-7, 1=sunday)
# use n=24 if you need (1-7, 1=monday)
# %Dw-n is replaced with the day number in week (0-6, 0=sunday)
# use n=24 if you need (0-6, 0=monday)
# Use 0 for n if you need current year, month, day, hour...
# Example: "/var/log/access_log.%YYYY-0%MM-0%DD-0.log"
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
# You can also use a pipe if log file come from a pipe :
# Example: "gzip -d
joncombe
3600 days ago
Procca, if the single digit month issue doesn't apply to you, it is quite easy to ignore it. :) It was put there in response to an issue another user was having from their ISP renaming their AWStats logs.

The latest version of JAWStats can now handle non-standard (i.e. default) filenames. If your installation of JAWStats still can't read in the AWStats data files I'll wager it is a permissions issue.

Please try copying a AWStats file to a new directory and seeing if you can read it from there.

« Back To Thread List

Participate in this discussion

 

You must be logged in to post in this thread.

 

Version 0.7 beta available now

Released 25th Janury 2009

Try the online demo or download now.

 
Latest JAWStats News:

Version 0.7 Beta Released

Sprechen Sie Deutsch? Multi-lingual JAWStats v0.7 is finally here.

posted 25th Jan '09. read more »
 

Help JAWStats

Please donate a dollar (or more!) towards the hosting costs for this site. This money doesn't go anywhere near my pocket, it is purely used against my hosting bill.

 

Get $50 off your webhosting

You could do far worse than choose Dreamhost. I've used them for 6 years and they're great. Simply enter the promo code: JAWSTATS on signup!