发新话题
打印

多服务器的日志合并统计—cronolog+awstats


推荐: 免费的SVN空间 http://code.svnspot.com

多服务器的日志合并统计—cronolog+awstats

1.下载安装cronolog
http://cronolog.org/download/index.html
—>  tar … && cd …&& ./configure && make && make install
2.awstats
可以参考我的awstats安装配置笔记
http://blog.zhangjianfeng.com/?p=317

3.配置http.conf
    CustomLog "|/usr/local/sbin/cronolog  /company/logs/apache/web1_access_log.%Y%m%d" combined
   …apachectl restart
4.最后就是把各台服务器的日志先同步到awstats服务器上,进行日志合并
  sort -m -t " " -k 4 -o log_all log1 log2 log3
  注释: -m: 使用 merge优化算法
5.把合并后的日志交给awstats分析即可
附:cronolog详细参数意义:
  • SpecifierDescription
    %%a literal % character
    %na new-line character
    %ta horizontal tab character
    Time fields
    %Hhour (00..23)
    %Ihour (01..12)
    %pthe locale's AM or PM indicator
    %Mminute (00..59)
    %Ssecond (00..61, which allows for leap seconds)
    %Xthe locale's time representation (e.g.: "15:12:47")
    %Ztime zone (e.g. GMT), or nothing if the time zone cannot be determined
    Date fields
    %athe locale's abbreviated weekday name (e.g.: Sun..Sat)
    %Athe locale's full weekday name (e.g.: Sunday .. Saturday)
    %bthe locale's abbreviated month name (e.g.: Jan .. Dec)
    %Bthe locale's full month name, (e.g.: January .. December)
    %cthe locale's date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996")
    %dday of month (01 .. 31)
    %jday of year (001 .. 366)
    %mmonth (01 .. 12)
    %Uweek of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year)
    %Wweek of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year)
    %wday of week (0 .. 6, where 0 corresponds to Sunday)
    %xlocale's date representation (e.g. today in Britain: "15/12/96")
    %yyear without the century (00 .. 99)
    %Yyear with the century (1970 .. 2038)

(http://www.fanqiang.com)

TOP

发新话题
最近访问的版块