[ 永远的UNIX::UNIX技术资料的宝库 ]

首页 > 应用专题 > Web > 正文
 

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

作者:佚名 来源:Linux时代 (2007-02-08 17:30:14)

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详细参数意义:

  1. Specifier Description
    %% a literal % character
    %n a new-line character
    %t a horizontal tab character
    Time fields
    %H hour (00..23)
    %I hour (01..12)
    %p the locale's AM or PM indicator
    %M minute (00..59)
    %S second (00..61, which allows for leap seconds)
    %X the locale's time representation (e.g.: "15:12:47")
    %Z time zone (e.g. GMT), or nothing if the time zone cannot be determined
    Date fields
    %a the locale's abbreviated weekday name (e.g.: Sun..Sat)
    %A the locale's full weekday name (e.g.: Sunday .. Saturday)
    %b the locale's abbreviated month name (e.g.: Jan .. Dec)
    %B the locale's full month name, (e.g.: January .. December)
    %c the locale's date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996")
    %d day of month (01 .. 31)
    %j day of year (001 .. 366)
    %m month (01 .. 12)
    %U week 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)
    %W week 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)
    %w day of week (0 .. 6, where 0 corresponds to Sunday)
    %x locale's date representation (e.g. today in Britain: "15/12/96")
    %y year without the century (00 .. 99)
    %Y year with the century (1970 .. 2038)

(http://www.fanqiang.com)



 
 相关文章
使用外部表分析eygle.com的网站访问日志 2007-02-06 16:41:10
squid日志分析软件sarg的安装和使用 2006-06-27 16:05:38
Sun E450 安装 Solaris 10 SPARC 工作日志 2006-06-23 16:15:19
Linux日志文件系统及性能分析(组图) 2006-06-08 15:10:32
FreeBSD 系统日志 2006-05-15 14:38:54
Solaris日志记录介绍 2007-02-02 11:46:14
 

★  感谢所有的作者为我们学习技术知识提供了一条捷径  ★
www.fanqiang.com