Forum Linux.général configurer awstats pour squid

Posté par  .
Étiquettes : aucune
0
20
fév.
2006
Bonjour,

Je voudrais configurer awstats pour faire les stats de mon proxy (squid 2.5STABLE12) mais je n'arrive à rien...

Le parser ne comprend pas mes logs qui sont du type :

1140304334.954 474 172.18.110.34 TCP_MISS/200 18975 GET http://www.google.fr - DIRECT/80.245.57.116 text/html

Les 10 champs par default de squid...

Lorsque j'exécute awstats.pl l'erreur est assez explicite :

[root@localhost cgi-bin]# ./awstats.pl -config=proxy -update
Update for config "/etc/awstats/awstats.proxy.conf"
With data in log file "/home/logs/2006/02/19/proxy/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read of your log.
Your log file /home/logs/2006/02/19/proxy/access.log must have a bad format or LogFormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
%time4 %other %host %code %bytesd %method %url %logname %other %other
This means each line in your web server log file need to have the following personalized log format:
%time4 %other %host %code %bytesd %method %url %logname %other %other
And this is an example of records AWStats found in your log file (the record number 50 in your log):
1140304334.954 474 172.18.110.34 TCP_MISS/200 18975 GET http://www.medi1.com/medi1/index.php - DIRECT/80.245.57.116 text/html
Setup ('/etc/awstats/awstats.proxyubo.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

L'attribut LogFormat est mal configuré! pourtant j'ai essayé plein de configs différentes, rien ne passe...

PS : Le début de mon fichier de conf est le suivant pour l'instant :

[root@localhost cgi-bin]# more /etc/awstats/awstats.proxy.conf
# AWSTATS CONFIGURE FILE 6.5
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats (See documentation in docs/ directory).
# The config file must be in /etc/awstats, /usr/local/etc/awstats or /etc (for
# Unix/Linux) or same directory than awstats.pl (Windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter (AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
# the config value in an AWStats running session and can be used like others.
#-----------------------------------------------------------------------------
# $Revision: 1.324 $ - $Author: eldy $ - $Date: 2005/10/30 15:56:38 $



#-----------------------------------------------------------------------------
# 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 </var/log/apache/access.log.gz |"
# If there is several log files from load balancing servers :
# Example: "/pathtotools/logresolvemerge.pl *.log |"
#
LogFile="/home/logs/%YYYY-24/%MM-24/%DD-24/proxy/access.log"

# Enter the log file type you want to analyze.
# Possible values:
# W - For a web log file
# S - For a streaming log file
# M - For a mail log file
# F - For a ftp log file
# Example: W
# Default: W
#
LogType=W


# Enter here your log format (Must match your web server config. See setup
# instructions in documentation to know how to configure your web server to
# have the required log format).
# Possible values: 1,2,3,4 or "your_own_personalized_log_format"
# 1 - Apache or Lotus Notes/Domino native combined log format (NCSA combined/XLF/ELF log format)
# 2 - IIS or ISA format (IIS W3C log format). See FAQ-COM115 For ISA.
# 3 - Webstar native log format.
# 4 - Apache or Squid native common log format (NCSA common/CLF log format)
# With LogFormat=4, some features (browsers, os, keywords...) can't work.
# "your_own_personalized_log_format" = If your log is ftp, mail or other format,
# you must use following keys to define the log format string (See FAQ for
# ftp, mail or exotic web log format examples):
# %host Client hostname or IP address (or Sender host for mail log)
# %host_r Receiver hostname or IP address (for mail log)
# %lognamequot Authenticated login/user with format: "john"
# %logname Authenticated login/user with format: john
# %time1 Date and time with format: [dd/mon/yyyy:hh:mm:ss +0000] or [dd/mon/yyyy:hh:mm:ss]
# %time2 Date and time with format: yyyy-mm-dd hh:mm:ss
# %time3 Date and time with format: Mon dd hh:mm:ss or Mon dd hh:mm:ss yyyy
# %time4 Date and time with unix timestamp format: dddddddddd
# %methodurl Method and URL with format: "GET /index.html HTTP/x.x"
# %methodurlnoprot Method and URL with format: "GET /index.html"
# %method Method with format: GET
# %url URL only with format: /index.html
# %query Query string (used by URLWithQuery option)
# %code Return code status (with format for web log: 999)
# %bytesd Size of document in bytes
# %refererquot Referer page with format: "http://from.com/from.htm"
# %referer Referer page with format: http://from.com/from.htm
# %uabracket User agent with format: [Mozilla/4.0 (compatible, ...)]
# %uaquot User agent with format: "Mozilla/4.0 (compatible, ...)"
# %ua User agent with format: Mozilla/4.0_(compatible...)
# %gzipin mod_gzip compression input bytes: In:XXX
# %gzipout mod_gzip compression output bytes & ratio: Out:YYY:ZZpct.
# %gzipratio mod_gzip compression ratio: ZZpct.
# %deflateratio mod_deflate compression ratio with format: (ZZ)
# %email EMail sender (for mail log)
# %email_r EMail receiver (for mail log)
# %virtualname Web sever virtual hostname. Use this tag when same log
# contains data of several virtual web servers. AWStats
# will discard records not in SiteDomain nor HostAliases
# %cluster If log file is provided from several computers (merged by
# logresolvemerge.pl), use this to define cluster id field.
# %extraX Another field that you plan to use for building a
# personalized report with ExtraSection feature (See later).
# If your log format has some fields not included in this list, use:
# %other Means another not used field
# %otherquot Means another not used double quoted field
#
# Examples for Apache combined logs (following two examples are equivalent):
# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot"
#
# Example for IIS:
# LogFormat = 2
#

LogFormat=%time4 %other %host %code %bytesd %method %url %logname %other %other




Si quelqu'un avait déjà eu ce genre de soucis, un coup de main serait bien venu... merci

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.