NpsAwstats used to generate advanced graphical web statistics with AWStats.
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically.
This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages.
click here to visit AWStats official website.
For smaller websites, we recommended to generate monthly or annual web statistics;
For medium and large sites, we recommended to generate daily or hourly web statistics.
1.perl must be installed in NPS server,and can be found in PATH.
2.Config "awstats_include.inc"
If Apache or Lotus Notes/Domino native combined log format are used for your web server config,No need to change anything.
1.Edit the file:{$NPS_HOME}/awstats/conf/awstats_include.inc
set LogFormat to your log format,it must match your web server config。
See AWStats setup instructions in documentation to know how to configure your web server to have the required log format.
2.Delete the file:{$TEMP_ROOTPATH}/awstats/conf/awstats_include.inc
3.Log format configuration for Apache httpd in httpd.conf:
1)combined log format
CustomLog /logs/httpd/www.jwebstar.com_access_log combined
2)common log format
CustomLog /logs/httpd/www.jwebstar.com_access_log common
4.You can also set LogFile in awstats_include.inc(See AWStats setup instructions in documentation).
However,the set will lapse once called AddNpsFile() or AddFile() function.
The sample code will generate all monthly web statistics.
|
var site = session.GetSite('jwebstar'); var awstats = new NpsAwstats(site,'en'); awstats.AddFile('/weblogs/jwebstar%YY-24%MM-24%DD-24.log'); var today = new Date(); var year = today.getYear(); if (year < 2000) year = year + 1900; var month = today.getMonth()+1; awstats.ReportAllByMonth(year,month); |
| NpsAwstats |
NpsAwstats(NpsSite site,String lang) construction. The lang parameter specified the international language would be used for report. AWStats can make reports in 41 languages. This is a list of all of them, for last version, in alphabetical order (The code you can use for Lang parameter are the ISO−639−1 language codes).
|
||||||||||||||||||||||||||||||||||||||||||||
| void |
AddNpsFile(NpsFile logfile) Add a log file to analyze. Multiple calls for a set of log file. |
||||||||||||||||||||||||||||||||||||||||||||
| void |
AddFile(String logfile) Add a log file to analyze. Possible values: A full path. 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) Example:"*.log" Example:"/weblogs/jwebstar%YY-24%MM-24%DD-24.log" |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportByYear(int year,String output) throws Exception Generate annual Report specified by output
|
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportAllByYear(int year) throws Exception Generate all annual report. |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportByMonth(int year,int month,String output) throws Exception Generate monthly report specified by output |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportAllByMonth(int year,int month) throws Exception Generate all monthly report. |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportByDay(int year,int month,int day,String output) throws Exception Generate daily report specified by output |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportAllByDay(int year,int month,int day) throws Exception Generate all daily report. |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportByHour(int year,int month,int day,int hour,String output) throws Exception Generate hourly report specified by output |
||||||||||||||||||||||||||||||||||||||||||||
| void |
ReportAllByHour(int year,int month,int day,int hour) throws Exception Generate all hourly report. |