From c6f0f3c7731d4dbafd0cece743b59186cfcdb78b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Oct 2014 15:32:41 +0200 Subject: [PATCH] Work with Amazon AWS log files (using %time5 tag). --- docs/awstats_changelog.txt | 1 + test/awstats/conf/awstats.testtime5.conf | 806 +++++++++++++++++++++++ test/test.pl | 2 +- wwwroot/cgi-bin/awstats.pl | 4 +- 4 files changed, 810 insertions(+), 3 deletions(-) create mode 100644 test/awstats/conf/awstats.testtime5.conf diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 5fc75f915..1fcca7f70 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -7,6 +7,7 @@ New features: - Add debian patch debian-patches-1019_allow_frame_resize.patch to add option nboflastupdatelookuptosave on command line. - #199 Added geoip6 plugin with support for IPv4 AND IPv6. +- Work with Amazon AWS log files (using %time5 tag). Fixes: - Fixes permission on some .pl scripts. diff --git a/test/awstats/conf/awstats.testtime5.conf b/test/awstats/conf/awstats.testtime5.conf new file mode 100644 index 000000000..afbc41454 --- /dev/null +++ b/test/awstats/conf/awstats.testtime5.conf @@ -0,0 +1,806 @@ +# AWStats configure file +#------------------------------------------------------------------------ +# Copy this file into awstats.www.myserver.mydomain.conf or awstats.conf +# and edit this new file to setup AWStats. +# If you don't understand what is a parameter, keep default value. +#------------------------------------------------------------------------ + + +# Main setup section (Required to /test AWStats working) +#------------------------------------------------------------------------ + +# "LogFile" contains the web 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 ) : +# +# If code is not added in index page, all this detection capabilities will be +# disabled. You must also check that ShowScreenSizeStats and ShowMiscStats +# parameters are set to 1 to make results appear in report page. +# If you change this parameter, you must also change the +# awstatsmisctrackerurl variable into the awstats_misc_tracker.js file. +# Change : Effective for new updates only. +# Possible value: Name of javascript tracker file added in HTML code +# Default: "/js/awstats_misc_tracker.js" +# +MiscTrackerUrl="/js/awstats_misc_tracker.js" + + +# Add here a list of kind of url (file extension) that must be counted as +# "Hit only" and not as a "Hit" and "Page/Download". You can set here all +# images extensions as they are hit downloaded that must be counted but they +# are not viewed pages. URLs with such extensions are not included in the TOP +# Pages/URL report. +# Note: If you want to exclude particular URLs from stats (No Pages and no +# Hits reported), you must use SkipFiles parameter. +# Change : Effective for new updates only +# Example: "css js class gif jpg jpeg png bmp ico zip arj gz z wav mp3 wma mpg" +# Example: "" +# Default: "css js class gif jpg jpeg png bmp ico" +# +NotPageList="css js class gif jpg jpeg png bmp ico" + + +# Default index page name for your web server. +# Change : Effective for new updates only +# Example: "index.php index.html default.html" +# Default: "index.html" +# +DefaultFile="index.php index.html" + + + + +#------------------------------------------------------------------------ +# Optionnal setup section (Not required but increase AWStats features) +#------------------------------------------------------------------------ + +# Set your primary language. +# Possible value: +# Albanian=al, Bosnian=ba, Bulgarian=bg, Catalan=ca, +# Chinese (Taiwan)=tw, Chinese (Simpliefied)=cn, Czech=cz, Danish=dk, +# Dutch=nl, English=en, Estonian=et, Euskara=eu, Finnish=fi, +# French=fr, Galician=gl, German=de, Greek=gr, Hebrew=he, Hungarian=hu, +# Icelandic=is, Indonesian=id, Italian=it, Japanese=jp, Korean=kr, +# Latvian=lv, Norwegian (Nynorsk)=nn, Norwegian (Bokmal)=nb, Polish=pl, +# Portuguese=pt, Portuguese (Brazilian)=br, Romanian=ro, Russian=ru, +# Serbian=sr, Slovak=sk, Spanish=es, Swedish=se, Turkish=tr, Ukrainian=ua, +# Welsh=wlk. +# First available language accepted by browser=auto +# Default: "auto" +# +Lang="auto" + + +# Do not include access from clients that match following criteria. +# If your log file contains IP adresses in host field, you must enter here +# matching IP adresses criteria. +# If DNS lookup is already done in your log file, you must enter here hostname +# criteria, else enter ip address criteria. +# The opposite parameter of "SkipHosts" is "OnlyHosts". +# Note: Use space between each value. This parameter is not case sensitive. +# Note: You can use regular expression values writing value with REGEX[value]. +# Change : Effective for new updates only +# Example: "127.0.0.1 REGEX[^192\.168\.] REGEX[^10\.0\.0\.]" +# Example: "localhost REGEX[^.*\.localdomain$]" +# Default: "" +# +SkipHosts="" + + +# Do not include access from clients with a user agent that match following +# criteria. If you want to exclude a robot, you should update the robots.pm +# file instead of this parameter. +# Note: Use space between each value. This parameter is not case sensitive. +# Note: You can use regular expression values writing value with REGEX[value]. +# Change : Effective for new updates only +# Example: "konqueror REGEX[ua_test_v\d\.\d]" +# Default: "" +# +SkipUserAgents="" + + +# Use SkipFiles to ignore access to URLs that match one of following entries. +# You can enter a list of not important URLs (like framed menus, hidden pages, +# etc...) to exclude them from statistics. You must enter here exact relative +# URL as found in log file, or a matching REGEX value. +# For example, to ignore /badpage.html, just add "/badpage.html". To ignore +# all pages in a particular directory, add "REGEX[^\/directorytoexclude]". +# The opposite parameter of "SkipFiles" is "OnlyFiles". +# Note: Use space between each value. This parameter is not case sensitive. +# Note: You can use regular expression values writing value with REGEX[value]. +# Change : Effective for new updates only +# Example: "/badpage.html REGEX[^\/excludedirectory]" +# Default: "" +# +SkipFiles="" + + +# Some web servers on some Operating systems (IIS-Windows) considers that a +# login with same value but different case are the same login. To tell AWStats +# to also considers them as one, set this parameter to 1. +# Possible values: 0 or 1 +# Default: 0 +# +AuthenticatedUsersNotCaseSensitive=1 + + +# Keep or remove the anchor string you can find in some URLs. +# Possible values: 0 or 1 +# Default: 0 +# +URLWithAnchor=0 + + +# In URL links, "?" char is used to add parameter's list in URLs. Syntax is: +# /mypage.html?param1=value1¶m2=value2 +# However, some servers/sites use also others chars to isolate dynamic part of +# their URLs. You can complete this list with all such characters. +# Change : Effective for new updates only +# Example: "?;," +# Default: "?;" +# +URLQuerySeparators="?;" + + +# Keep or remove the query string to the URL in the statistics for individual +# pages. This is primarily used to differentiate between the URLs of dynamic +# pages. If set to 1, mypage.html?id=x and mypage.html?id=y are counted as two +# different pages. +# Warning, when set to 1, memory required to run AWStats is dramatically +# increased if you have a lot of changing URLs (for example URLs with a random +# id inside). Such web sites should not set this option to 1 or use seriously +# the next parameter URLWithQueryWithOnlyFollowingParameters (or eventually +# URLWithQueryWithoutFollowingParameters). +# Change : Effective for new updates only +# Possible values: +# 0 - URLs are cleaned from the query string (ie: "/mypage.html") +# 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y") +# Default: 0 +# +URLWithQuery=1 + + +# When URLWithQuery is on, you will get the full URL with all parameters in +# URL reports. But among thoose parameters, sometimes you don't need a +# particular parameter because it does not identify the page or because it's +# a random ID changing for each access even if URL points to same page. In +# such cases, it is higly recommanded to ask AWStats to keep only parameters +# you need (if you know them) before counting, manipulating and storing it. +# Enter here list of wanted parameters. For example, with "param", one hit on +# /mypage.cgi?param=abc&id=Yo4UomP9d and /mypage.cgi?param=abc&id=Mu8fdxl3r +# will be reported as 2 hits on /mypage.cgi?param=abc +# This parameter is not used when URLWithQuery is 0 and can't be used with +# URLWithQueryWithoutFollowingParameters. +# Change : Effective for new updates only +# Example: "param" +# Default: "" +# +URLWithQueryWithOnlyFollowingParameters="" + + +# When URLWithQuery is on, you will get the full URL with all parameters in +# URL reports. But among thoose parameters, sometimes you don't need a +# particular parameter because it does not identify the page or because it's +# a random ID changing for each access even if URL points to same page. In +# such cases, it is higly recommanded to ask AWStats to remove such parameters +# from the URL before counting, manipulating and storing it. Enter here list +# of all non wanted parameters. For example if you enter "id", one hit on +# /mypage.cgi?p=abc&id=Yo4UomP9d and /mypage.cgi?p=abc&id=Mu8fdxl3r +# will be reported as 2 hits on /mypage.cgi?p=abc +# This parameter is not used when URLWithQuery is 0 and can't be used with +# URLWithQueryWithOnlyFollowingParameters. +# Change : Effective for new updates only +# Example: "PHPSESSID jsessionid" +# Default: "" +# +URLWithQueryWithoutFollowingParameters="productId jsessionid" + + +# Keep or remove the query string to the referrer URL in the statistics for +# external referrer pages. This is used to differentiate between the URLs of +# dynamic referrer pages. If set to 1, mypage.html?id=x and mypage.html?id=y +# are counted as two different referrer pages. +# Change : Effective for new updates only +# Possible values: +# 0 - Referrer URLs are cleaned from the query string (ie: "/mypage.html") +# 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y") +# Default: 0 +# +URLReferrerWithQuery=0 + + +# AWStats can detect setup problems or show you important informations to have +# a better use. Keep this to 1, except if AWStats says you can change it. +# Possible values: 1 or 0 +# Default: 1 +WarningMessages=1 + + + +#----------------------------------------------------------------------------- +# OPTIONAL ACCURACY SETUP SECTION (Not required but increase AWStats features) +#----------------------------------------------------------------------------- + +# Following values allows you to define accuracy of AWStats entities (robots, +# browsers, os, referers, file types) detection. +# It is recommanded that very important web sites or ISP that provides AWStats +# to their customer set this parameter to 1 (or 0), instead of 2. +# Possible values: +# 0 = No detection, +# 1 = Medium/Standard detection +# 2 = Full detection +# Change : Effective for new updates only +# Default: 2 (0 for LevelForWormsDetection) +# +LevelForBrowsersDetection=2 # 0 disables Browsers detection. +LevelForOSDetection=2 # 0 disables OS detection. +LevelForRefererAnalyze=2 # 0 disables Origin detection. +LevelForRobotsDetection=2 # 0 disables Robots detection. +LevelForSearchEnginesDetection=2 # 0 disables Search engines detection. +LevelForKeywordsDetection=2 # 0 disables Keyphrases/Keywords detection. +LevelForFileTypesDetection=1 # 0 disables File types detection. +LevelForWormsDetection=2 # 0 disables Worms detection. + + + +#----------------------------------------------------------------------------- +# OPTIONAL APPEARANCE SETUP SECTION (Not required but increase AWStats features) +#----------------------------------------------------------------------------- + +# When you use AWStats as a CGI, you can have the reports shown in HTML frames. +# Frames are only available for report viewed dynamically. When you build +# pages from command line, this option is not used and no frames are built. +# Possible values: 0 or 1 +# Default: 1 +# +UseFramesWhenCGI=1 + + +# Each URL shown in stats page are links you can click. +# Possible values: 1 or 0 +# Default: 1 +# +ShowLinksOnUrl=1 + + +# List of visible flags that links to other language translations. +# See Lang parameter for list of allowed flag/language codes. +# If you don't want any flag link, set ShowFlagLinks to "". +# This parameter is used only if ShowMenu parameter is set to 1. +# Possible values: "" or "language_codes_separated_by_space" +# Example: "en es fr nl es" +# Default: "" +# +ShowFlagLinks="fr" + + +# Search engines keywords reported are full search string or separate keywords +# Possible values: +# 0 - Search keywords reported are full search string (ie: "town maps") +# 1 - Search keywords reported are separated words (ie: "town" and "maps") +# Default: 0 +# +SplitSearchString=0 + + +# You can put here HTML code that will be added at the end of AWStats reports. +# Great to add advert ban. +# Default: "" +# +HTMLEndSection="" + + +# Value of maximum bar width/heigth for horizontal/vertical graphics bar +# Default: 260/220 +# +BarWidth = 260 +BarHeight = 220 + + +# This value can be used to choose maximum number of lines shown for each +# particular reporting. +# +# Stats by domains +MaxNbOfDomain = 25 +# Stats by hosts +MaxNbOfHostsShown = 25 +MinHitHost = 1 +# Stats by authenticated users +MaxNbOfLoginShown = 5 +MinHitLogin = 1 +# Stats by robots +MaxNbOfRobotShown = 25 +MinHitRobot = 1 +# Stats by pages +MaxNbOfPageShown = 25 +MinHitFile = 1 +# Stats by referers +MaxNbOfRefererShown = 25 +MinHitRefer = 1 +# Stats for keywords +MaxNbOfKeywordsShown = 25 +MinHitKeyword = 1 + + +ShowHeader=1 # Show AWStats head title and icon +ShowMenu=1 # Show menu header with links on detailed reports +ShowMonthDayStats=1 +ShowDaysOfWeekStats=1 +ShowHoursStats=1 +ShowDomainsStats=1 +ShowHostsStats=1 +ShowAuthenticatedUsers=1 +ShowRobotsStats=1 +ShowPagesStats=1 +ShowCompressionStats=0 # Show report of compression stats when using mod_gzip +ShowFileTypesStats=1 +ShowFileSizesStats=0 # Not yet available +ShowBrowsersStats=1 +ShowOSStats=1 +ShowOriginStats=1 +ShowKeyphrasesStats=1 +ShowKeywordsStats=1 +ShowHTTPErrorsStats=1 +ShowWormsStats=1 +# Show misc chart +# Default: a (See also MiscTrackerUrl parameter), Possible codes: ajdfrqwp +ShowMiscStats=ajdfrqwp +ShowScreenSizeStats=1 + + +# In the Origin chart, you have stats on where your hits came from. You can +# includes hits on pages that comes from pages of same sites in this chart. +# Possible values: 0 or 1 +# Default: 0 +# +IncludeInternalLinksInOriginSection=1 + + + +#----------------------------------------------------------------------------- +# PLUGINS +#----------------------------------------------------------------------------- + +# Add here all plugin files you want to load. +# Plugin files must be .pm files stored in 'plugins' directory. +# Uncomment LoadPlugin lines to enable a plugin after checking that perl +# modules required by the plugin are installed. + +# PLUGIN: Tooltips +# REQUIRED MODULES: None +# PARAMETERS: None +# DESCRIPTION: Add tooltips pop-up help boxes to HTML report pages. +# NOTE: This will increased HTML report pages size, thus server load and bandwidth. +# +#LoadPlugin="tooltips" + +# PLUGIN: DecodeUTFKeys +# REQUIRED MODULES: Encode and URI::Escape +# PARAMETERS: None +# DESCRIPTION: Allow AWStats to show correctly (in language charset) +# keywords/keyphrases strings even if they were UTF8 coded by the +# referer search engine. +# +#LoadPlugin="decodeutfkeys" + +# PLUGIN: IPv6 +# PARAMETERS: None +# REQUIRED MODULES: Net::IP and Net::DNS +# DESCRIPTION: This plugin gives AWStats capability to make reverse DNS +# lookup on IPv6 addresses. +# +#LoadPlugin="ipv6" + +# PLUGIN: HashFiles +# REQUIRED MODULES: Storable +# PARAMETERS: None +# DESCRIPTION: AWStats DNS cache files are read/saved as native hash files. +# This increases DNS cache files loading speed, above all for very large web sites. +# +#LoadPlugin="hashfiles" + + +# PLUGIN: UserInfo +# REQUIRED MODULES: None +# PARAMETERS: None +# DESCRIPTION: Add a text (Firtname, Lastname, Office Department, ...) in +# authenticated user reports for each login value. +# A text file called userinfo.myconfig.txt, with two fields (first is login, +# second is text to show, separated by a tab char) must be created in DirData +# directory. +# +#LoadPlugin="userinfo" + +# PLUGIN: HostInfo +# REQUIRED MODULES: Net::XWhois +# PARAMETERS: None +# DESCRIPTION: Add a column into host chart with a link to open a popup window that shows +# info on host (like whois records). +# +#LoadPlugin="hostinfo" + +# PLUGIN: ClusterInfo +# REQUIRED MODULES: None +# PARAMETERS: None +# DESCRIPTION: Add a text (for example a full hostname) in cluster reports for each cluster +# number. A text file called clusterinfo.myconfig.txt, with two fields (first is +# cluster number, second is text to show) separated by a tab char. must be +# created into DirData directory. +# Note this plugin is useless if ShowClusterStats is set to 0 or if you don't +# use a personalized log format that contains %cluster tag. +# +#LoadPlugin="clusterinfo" + +# PLUGIN: UrlAliases +# REQUIRED MODULES: None +# PARAMETERS: None +# DESCRIPTION: Add a text (Page title, description...) in URL reports before URL value. +# A text file called urlalias.myconfig.txt, with two fields (first is URL, +# second is text to show, separated by a tab char) must be created into +# DirData directory. +# +#LoadPlugin="urlalias" + +# PLUGIN: TimeHiRes +# REQUIRED MODULES: Time::HiRes (if Perl < 5.8) +# PARAMETERS: None +# DESCRIPTION: Time reported by -showsteps option is in millisecond. For debug purpose. +# +#LoadPlugin="timehires" + +# PLUGIN: TimeZone +# REQUIRED MODULES: Time::Local +# PARAMETERS: [timezone offset] +# DESCRIPTION: Allow AWStats to adjust time stamps for a different timezone +# This plugin reduces AWStats speed of 10% !!!!!!! +# LoadPlugin="timezone" +# LoadPlugin="timezone +2" +# LoadPlugin="timezone CET" +# +#LoadPlugin="timezone +2" + +# PLUGIN: Rawlog +# REQUIRED MODULES: None +# PARAMETERS: None +# DESCRIPTION: This plugin adds a form in AWStats main page to allow users to see raw +# content of current log files. A filter is also available. +# +#LoadPlugin="rawlog" + +# PLUGIN: GraphApplet +# REQUIRED MODULES: None +# PARAMETERS: [CSS classes to override] +# DESCRIPTION: Supported charts are built by a 3D graphic applet. +# +#LoadPlugin="graphapplet /awstatsclasses" # EXPERIMENTAL FEATURE + +# PLUGIN: GraphGoogleChartAPI +# REQUIRED MODULES: None +# PARAMETERS: None +# DESCRIPTION: Replaces the standard charts with free Google API generated images +# in HTML reports. If country data is available and more than one country has hits, +# a map will be generated using Google Visualizations. +# Note: The machine where reports are displayed must have Internet access for the +# charts to be generated. The only data sent to Google includes the statistic numbers, +# legend names and country names. +# Warning: This plugin is not compatible with option BuildReportFormat=xhtml. +# +#LoadPlugin="graphgooglechartapi" + +# PLUGIN: GeoIPfree +# REQUIRED MODULES: Geo::IPfree version 0.2+ (from Graciliano M.P.) +# PARAMETERS: None +# DESCRIPTION: Country chart is built from an Internet IP-Country database. +# This plugin is useless for intranet only log files. +# Note: You must choose between using this plugin (need Perl Geo::IPfree +# module, database is free but not up to date) or the GeoIP plugin (need +# Perl Geo::IP module from Maxmind, database is also free and up to date). +# Note: Activestate provide a corrupted version of Geo::IPfree 0.2 Perl +# module, so install it from elsewhere (from www.cpan.org for example). +# This plugin reduces AWStats speed by up to 10% ! +# +#LoadPlugin="geoipfree" + +# MAXMIND GEO IP MODULES: Please see documentation for notes on all Maxmind modules + +# PLUGIN: GeoIP +# REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind) +# PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/geoip.dat] +# DESCRIPTION: Builds a country chart and adds an entry to the hosts +# table with country name +# Replace spaces in the path of geoip data file with string "%20". +# +LoadPlugin="geoip GEOIP_STANDARD /home/ldestailleur/git/awstats/test/maxmind/GeoIP.dat" + +# PLUGIN: GeoIP_City_Maxmind +# REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind) +# PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPCity.dat] +# DESCRIPTION: This plugin adds a column under the hosts field and tracks the pageviews +# and hits by city including regions. +# Replace spaces in the path of geoip data file with string "%20". +# +LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /home/ldestailleur/git/awstats/test/maxmind/GeoIPCity-532.dat" + +# PLUGIN: GeoIP_ASN_Maxmind +# REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind) +# PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPASN.dat[+/pathto/override.txt][+http://linktoASlookup]] +# DESCRIPTION: This plugin adds a chart of AS numbers where the host IP address is registered. +# This plugin can display some ISP information if included in the database. You can also provide +# a link that will be used to lookup additional registration data. Put the link at the end of +# the parameter string and the report page will include the link with the full AS number at the end. +# Replace spaces in the path of geoip data file with string "%20". +# +#LoadPlugin="geoip_asn_maxmind GEOIP_STANDARD /usr/local/geoip.dat+http://enc.com.au/itools/aut-num.php?autnum=" + +# PLUGIN: GeoIP_Region_Maxmind +# REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind) +# PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPRegion.dat] +# DESCRIPTION:This plugin adds a chart of hits by regions. Only regions for US and +# Canada can be detected. +# Replace spaces in the path of geoip data file with string "%20". +# +LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /home/ldestailleur/git/awstats/test/maxmind/GeoIPRegion-515.dat" + +# PLUGIN: GeoIP_ISP_Maxmind +# REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind) +# PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPISP.dat] +# DESCRIPTION: This plugin adds a chart of hits by ISP. +# Replace spaces in the path of geoip data file with string "%20". +# +#LoadPlugin="geoip_isp_maxmind GEOIP_STANDARD /home/ldestailleur/git/awstats/test/maxmind/GeoIPISP-122.dat" + +# PLUGIN: GeoIP_Org_Maxmind +# REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind) +# PARAMETERS: [GEOIP_STANDARD | GEOIP_MEMORY_CACHE] [/pathto/GeoIPOrg.dat] +# DESCRIPTION: This plugin add a chart of hits by Organization name +# Replace spaces in the path of geoip data file with string "%20". +# +LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /home/ldestailleur/git/awstats/test/maxmind/GeoIPOrg-111.dat" + + + +#----------------------------------------------------------------------------- +# EXTRA SECTION +#----------------------------------------------------------------------------- + +# WARNING: Extra sections are experimental feature not stable yet !!! + +# You can define your own charts, you choose here what are rows and columns +# keys. This feature is particularly usefull for marketing purpose, tracking +# products orders for example. +# For this, edit all parameters of Extra section. Each set of parameter is a +# different chart. For several charts, duplicate section changing the number. +# Note that each Extra section reduces AWStats speed by 10%. +# +# WARNING: A wrong setup of Extra section can result in a too large arrays +# that will consume all your memory, making AWStats unusable after several +# updates, so be sure to setup it correctly. +# In most cases, you don't need this feature. +# +# ExtraSectionNameX is title of your personalized chart. +# ExtraSectionConditionalX are conditions on URL and/or QUERY_STRING and/or +# REFERER you can use to count or not the hit. Use "|" for "OR". +# ExtraSectionFirstColumnTitleX is the first column title of the chart. +# ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats how to +# extract the value used for first column. Each different value found will +# be a different row. Be sure that list of different values is "limited" to +# avoid "not enough memory" problems ! +# ExtraSectionStatTypesX are things you want to count. You can use standard +# code letters (P for pages,H for hits,B for bandwidth,L for last access). +# MaxNbOfExtraX is maximum number of rows shown in chart. +# MinHitExtraX is minimum number of hits required to be shown in chart. +# + +# Example to report the 20 products the most ordered by "order.cgi" script +ExtraSectionName1="Product orders" +ExtraSectionCondition1="URL,\/cgi\-bin\/order\.cgi|URL,\/cgi-bin2\/order\.cgi" +ExtraSectionFirstColumnTitle1="Product ID" +ExtraSectionFirstColumnValues1="QUERY_STRING,productId=([^&]+)" +ExtraSectionStatTypes1=PL +MaxNbOfExtra1=20 +MinHitExtra1=1 + + +ExtraSectionName2="Redirect" +ExtraSectionCondition2="URL,\/cgi\-bin\/awredir\.pl" +ExtraSectionFirstColumnTitle2="Url" +ExtraSectionFirstColumnValues2="QUERY_STRING,url=([^&]+)" +ExtraSectionStatTypes2=HL +MaxNbOfExtra2=20 +MinHitExtra2=1 diff --git a/test/test.pl b/test/test.pl index f35aa3fd1..23ece8478 100755 --- a/test/test.pl +++ b/test/test.pl @@ -46,7 +46,7 @@ "testpostfix4", "testexchange"); -@TESTLIST=("testglobal","testsmall"); +@TESTLIST=("testglobal","testsmall","testtime5"); #@TESTLIST=("testlogins"); #@TESTLIST=("testworms"); #@TESTLIST=("testipv6"); diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 8e40988c2..7a56af5a4 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -9154,7 +9154,7 @@ sub DefinePerlParsingFormat { push @fieldlib, 'date'; $PerlParsingFormat .= "(\\d+)"; } - elsif ( $f =~ /%time5$/ ) { # yyyy-mm-ddThh:mm:ss+00:00 (iso format) + elsif ( $f =~ /%time5$/ ) { # yyyy-mm-ddThh:mm:ss+00:00 (iso format) or yyyy-mm-ddThh:mm:ss.000000Z $pos_date = $i; $i++; push @fieldlib, 'date'; @@ -9162,7 +9162,7 @@ sub DefinePerlParsingFormat { $i++; push @fieldlib, 'tz'; $PerlParsingFormat .= -"([^$LogSeparatorWithoutStar]+T[^$LogSeparatorWithoutStar]+)([-+]\\d\\d(?::?\\d\\d)?)"; +"([^$LogSeparatorWithoutStar]+T[^$LogSeparatorWithoutStar]+)([-+\.]\\d\\d[:\\.\\dZ]*)"; } # Special for methodurl and methodurlnoprot