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

第 77 章 Logs 分析

目录

77.1. log
77.1.1. logwatch
77.1.2. nulog
77.2. Web
77.2.1. Apache Log
77.2.1.1. 刪除日志
77.2.1.2. 统计爬虫
77.2.1.3. 统计浏览器
77.2.1.4. IP 统计
77.2.1.5. 统计域名
77.2.1.6. HTTP Status
77.2.1.7. URL 统计
77.2.1.8. 文件流量统计
77.2.1.9. URL访问量统计
77.2.1.10. 脚本运行速度
77.2.1.11. IP, URL 抽取
77.2.2. Tomcat Log
77.2.2.1. 截取 0-3 点区间的日志
77.2.3. awstats
77.2.3.1. 语言
77.2.3.2. 输出HTML文档
77.2.3.3. 多站点配置
77.2.3.4. 合并日志
77.2.3.5. Flush history file on disk (unique url reach flush limit of 5000) 优化
77.2.3.6. JAWStats
77.2.4. webalizer
77.2.4.1. 手工生成
77.2.4.2. 批量处理历史数据
77.2.4.3. crontab
77.2.5. Sarg - Squid Analysis Report Generator
77.2.6. goaccess - Fast web log analyzer and interactive viewer.
77.3. rinetd.log
77.4. php-syslog-ng
77.5. Log Analyzer
77.6. Splunk
77.7. logstash - open source log management
77.8. Octopussy
77.9. eventlog-to-syslog
77.10. Apache Flume

77.1. log

77.1.1. logwatch

logwatch - log analyser with nice output written in Perl

http://www.logwatch.org/

过程 77.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

77.1.2. nulog

例 77.1. config.php

				

				
				

comments powered by Disqus