GoAccess Apache 日志统计

GoAccess 是一款开源的网站日志实时分析工具。GoAccess 的工作方式很容易理解,就是读取和解析 Apache/Nginx/Lighttpd 的访问日志文件 access log,然后以更友好的方式把统计信息显示出来。统计的内容包括:访问概况、动态页面请求、静态页面请求(如图片、样式表、脚本等)、访客排名,访客使用 的操作系统,访客使用的浏览器,来路域名,404 错误,搜索爬虫,搜索关键词等等。

GoAccess 的性能也不赖,据官方测试,在一台 Intel Xeon CPU @ 2.40ghz CPU, 2GB 内存的机器上处理日志文件的速度是97000行每秒。

Linux 发行版本自带的 GoAccess 一般太老,比如 Ubuntu 12.04 带的是 0.4.2,Ubuntu 13.10 带的是 0.5,而最新的 goaccess 版本是 0.7.1. 所以类似不常用的软件,Linux 发行官方关注也少,为了使用最新的版本,最好采用源代码安装的方式。

CentOS 6.5 上安装编译 GoAccess 时需要的工具和库:

# YUM groupinstall 'Development Tools'
# yum install GLib2 glib2-devel ncurses-devel

在 Ubuntu 12.04 上安装编译 GoAccess 时需要的工具和库:

$ sudo apt-get install build-essential
$ sudo apt-get install libglib2.0-dev libncursesw5-dev

下载 GoAccess 的源代码、编译和安装:

$ Wget http://downloads.SourceForge.NET/project/goaccess/0.7.1/goaccess-0.7.1.tar.gz
$ tar -xzvf goaccess-0.7.1.tar.gz
$ cd goaccess-0.7.1/
$ ./configure --enable-utf8
$ Make
$ sudo make install

运行 GoAccess,选择 NCSA Combined Log Format:

$ /usr/local/bin/goaccess -f /var/log/apache2/access.log


                  +--------------------------------------------------+
                  | Log Format ConfiguRATion                         |
                  | [SPACE] to toggle - [ENTER] to proceed           |
                  |                                                  |
                  | [ ] Common Log Format (CLF)                      |
                  | [ ] Common Log Format (CLF) with Virtual Host    |
                  | [x] NCSA Combined Log Format                     |
                  | [ ] NCSA Combined Log Format with Virtual Host   |
                  | [ ] W3C                                          |
                  | [ ] CloudFront (Download Distribution)           |
                  |                                                  |
                  | Log Format - [c] to add/edit format              |
                  | %h %^[%d:%^] "%r" %s %b "%R" "%u"                |
                  |                                                  |
                  | Date Format - [d] to add/edit format             |
                  | %d/%b/%Y                                         |
                  +--------------------------------------------------+

界面如下:

GoAccess

 

 

 

 

 

 

 

 

 

 

 

 

 

 

GoAccess 还可以生成 HTML 格式的报告:

$ /usr/local/bin/goaccess -f /var/log/apache2/access.log -a > report.html
GoAccess v1.1 发布,Apache 日志统计
GoAccess v1.1 发布了,部分更新内容如下: 为 HTML 报告和其他设置和更改添加了新布局 将“Amazon S3”日志格式添加到预定义选项列表 在操作系统列表中添加了“Android 7.1 Nougat”

发布于 2016-11-09 00:01:53 | 109 次阅读

GoAccess 1.0.1 发布,Apache 日志统计
GoAccess 1.0.1 发布,此版本更新内容:Added Android version number along with the codename when using --real-os, e.g., 'Lollipop 5.1'.Added some missing headers and function checks to configure.ac.Fixed build issues on systems running GLIBC older than 2.9, such as RHEL <= 5.Fixed a re

发布于 2016-06-19 00:48:52 | 140 次阅读

GoAccess 0.9.7 发布,Apache 日志统计
GoAccess 0.9.7 发布,此版本更新内容:  - 添加 Squid 原生日志格式到配置文件  - Fixed int overflow when getting total bandwidth using the on-disk storage.  - Fixed issue where a timestamp was stored as date under the visitors panel.  - Fixed issue where config dialog fields were no

发布于 2015-12-22 00:58:35 | 142 次阅读

GoAccess 0.9.5 发布,Apache 日志统计
GoAccess 0.9.5 发布,此版本更新内容如下:- Added major performance improvements to the default storage when parsing and    storing data (~%44 less memory, ~37% faster).  - Added the ability to parse virtual hosts and a new panel to display metrics    per virtual ho

发布于 2015-10-22 08:51:42 | 235 次阅读

GoAccess 0.9.4 发布,Apache 日志统计
GoAccess 0.9.4 发布,更新内容如下:  - Fixed inability to parse color due to a missing POSIX extension. ERR:    Invalid bg/fg color pairs  - Added `%~` specifier to move forward through a log string until a non-space    char is found.  - Added the ability

发布于 2015-09-09 00:55:25 | 175 次阅读

GoAccess 0.9.3 发布,Apache 日志统计
GoAccess 0.9.3 发布,更新内容如下:  - Added the ability to set custom colors on the terminal output.  - Added the ability to process logs incrementally.  - Added a default color palette (Monokai) to the config file.  - Added column headers for every enabled metric on each panel.

发布于 2015-08-27 00:28:37 | 169 次阅读

GoAccess 0.9.2 发布,Apache 日志统计
GoAccess 0.9.2 发布,更新内容如下:+  * Added ability to fully parse browsers that contain spaces within a token.+  * Added multiple user agents to the list of browsers.+  * Added the ability to handle time served in milliseconds as a decimal number `%L`.+  * Added the ability to

发布于 2015-07-06 23:59:29 | 182 次阅读

GoAccess 0.9.1 发布,Apache 日志统计
GoAccess 0.9.1 发布,此版本更新内容如下:  * Added additional Nginx-specific status codes.  * Added Applebot to the list of web crawlers.  * Added Microsoft Edge to the list of browsers.  * Added the ability to highlight active panel through --hl-header.  * Ensu

发布于 2015-05-27 03:57:23 | 151 次阅读

GoAccess 0.9 发布,Apache 日志统计
GoAccess 0.9 发布,此版本现已提供下载:https://github.com/allinurl/goaccess/archive/v0.9.zip。更新内容如下:* Added ability to double decode an HTTP referer and agent.* Added ability to sort views through the command line on initial load.* Added additional data values to the bac

发布于 2015-03-19 07:32:11 | 278 次阅读

GoAccess 0.8.5 发布,Apache 日志统计
GoAccess 0.8.5 发布,此版本现已提供下载,更新内容如下: * Fixed SEGFAULT when parsing a malformed request that doesn't have HTTP status.GoAccess 0.8.4 更新内容如下:Added ability to handle&

发布于 2014-09-14 23:31:33 | 227 次阅读


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务