zoukankan      html  css  js  c++  java
  • 使用GoAccess构建简单实时日志分析系统

    很早就知道Nginx日志分析工具GoAccess,但之前由于只能静态分析,感觉不太强大。最近发现它能够实时显示报表而且报表也比之前强大很多能做趋势分析。因此果断下载安装。以下是基于CentOS的安装配置步骤。


    1、安装 GeoIP
    sudo yum install geoip geoip-devel

    2、安装
    centos: yum install go access
    或源码安装
    $ wget http://tar.goaccess.io/goaccess-1.1.1.tar.gz $ tar -xzvf goaccess-1.1.1.tar.gz $ cd goaccess-1.1.1/ $ ./configure --enable-geoip --enable-utf8 $ make # make install

    3、配置时间和日志格式
    sudo vim /usr/local/etc/goaccess.conf
    将以下项目的注释去掉
    1. Apache/nginx time format time-format %H:%M:%S
    2. Apache/nginx date format date-format %d/%b/%Y
    3. NCSA Comobined log format log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u”

    4.运行如下命令实时分析
    goaccess -f /home/wwwlogs/access.log -o <output_path>/state.html --real-time-html --date-spec=hr --hour-spec=min --ws-url=www.cbcye.com

    效果预览

  • 相关阅读:
    231. Power of Two
    204. Count Primes
    205. Isomorphic Strings
    203. Remove Linked List Elements
    179. Largest Number
    922. Sort Array By Parity II
    350. Intersection of Two Arrays II
    242. Valid Anagram
    164. Maximum Gap
    147. Insertion Sort List
  • 原文地址:https://www.cnblogs.com/cbcye/p/6464138.html
Copyright © 2011-2022 走看看