Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品与服务 | Email

第 15 章 Logs 分析

目录

15.1. log
15.1.1. logwatch
15.1.2. nulog
15.2. Web
15.2.1. Apache Log
15.2.1.1. 刪除日志
15.2.1.2. 统计爬虫
15.2.1.3. 统计浏览器
15.2.1.4. IP 统计
15.2.1.5. 统计域名
15.2.1.6. HTTP Status
15.2.1.7. URL 统计
15.2.1.8. 文件流量统计
15.2.1.9. URL访问量统计
15.2.1.10. 脚本运行速度
15.2.1.11. IP, URL 抽取
15.2.2. Tomcat Log
15.2.2.1. 截取 0-3 点区间的日志
15.2.3. awstats
15.2.3.1. 语言
15.2.3.2. 输出HTML文档
15.2.3.3. 多站点配置
15.2.3.4. 合并日志
15.2.3.5. Flush history file on disk (unique url reach flush limit of 5000) 优化
15.2.3.6. JAWStats
15.2.4. webalizer
15.2.4.1. 手工生成
15.2.4.2. 批量处理历史数据
15.2.4.3. crontab
15.2.5. Sarg - Squid Analysis Report Generator
15.2.6. goaccess - Fast web log analyzer and interactive viewer.
15.3. rinetd.log
15.4. php-syslog-ng
15.5. Log Analyzer
15.6. Splunk
15.7. logstash - open source log management
15.8. Octopussy
15.9. eventlog-to-syslog
15.10. Apache Flume

15.1. log

15.1.1. logwatch

logwatch - log analyser with nice output written in Perl

http://www.logwatch.org/

过程 15.1. logwatch 安装步骤:

  1. Install

    Ubuntu 7.10

    netkiller@shenzhen:/etc/webmin$ apt-cache search logwatch
    fwlogwatch - Firewall log analyzer
    logwatch - log analyser with nice output written in Perl
    					

    apt-get install

    # apt-get install logwatch
    					

    the logwatch has been installed, it should create a file in '/etc/cron.daily/00logwatch'.

  2. config

    $ sudo cp /usr/share/logwatch/default.conf/logwatch.conf  /etc/logwatch/conf/logwatch.conf
    $ sudo mkdir /var/cache/logwatch
    $ sudo vim /etc/logwatch/conf/logwatch.conf
    					

    mail to

    # Default person to mail reports to.  Can be a local account or a
    # complete email address.
    MailTo = root, openunix@163.com, other@example.com
    					

    To change detail level for the report

    # The default detail level for the report.
    # This can either be Low, Med, High or a number.
    # Low = 0
    # Med = 5
    # High = 10
    Detail = High
    					

    Crontab

    netkiller@shenzhen:~$ cat /etc/cron.daily/00logwatch
    #!/bin/bash
    
    #Check if removed-but-not-purged
    test -x /usr/share/logwatch/scripts/logwatch.pl || exit 0
    
    #execute
    /usr/sbin/logwatch
    					
  3. The logwatch is command, you can run it.


     logwatch --print 

    单独查看某个服务,比如 SSH 登录信息

    logwatch --service sshd --print

15.1.2. nulog

例 15.1. config.php

				

				
				

comments powered by Disqus