您的位置:首页 > 运维架构 > Nginx

nginx 访问日志分析工具 goacess

2015-08-11 00:00 567 查看
摘要: 20150702 nginx 访问日志分析 goacess

20150702 nginx 访问日志分析 goacess

1.安装GoAccess需要一些系统支持库
yum install glib2 glib2-devel GeoIP-devel  ncurses-devel zlib zlib-devel

2.如果yum库找不到Geo-IP 那么需要单独安装了.
cd /usr/local/src
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz[/code] 3.安装GeoIP库
tar xzvf GeoIP-1.4.6.tar.gz
cd GeoIP-1.4.6
./configure && make && make install
mv GeoIP.dat.gz /usr/local/share/GeoIP/

4.安装GoAccess
$ wget http://tar.goaccess.io/goaccess-0.8.1.tar.gz $ tar -xzvf goaccess-0.8.1.tar.gz
$ cd goaccess-0.8.1/
$ ./configure --enable-geoip --enable-utf8
$ make
# make install

如果启动GoAccess的时候出现以下提示
goaccess: error while loading shared libraries: libGeoIP.so.1

可以使用这个命令解决
ln -s /usr/local/lib/libGeoIP.so* /lib64/

5、菜单

菜单介绍
F1 帮助菜单
F5 刷新
q 退出当前口窗、菜单、或是当前查看的选项
o 打开当前的选项、菜单
c 改变窗口配色(目前只有两种 默认和绿色)
SHIFT + TAB 从当前选定模块向后切换
RIGHT 打开当前选中模块,查看详细信息
s 通过日期排序,只会在访问请求模块起作用
S 通过点击次数排序,只会在访问请求模块起作用
/ 查看详细信息的窗口进行搜索
n 通过/进行查找后,查找下个匹配的内容的位置,如果没有则在窗口底部显示“search hit BOTTOM”
t 在查看详细信息窗口,移动指针到最顶部
b 在查看详细信息窗口,移动指针到最底部

6、例子
goaccess -f access.log
#排除某一ip
goaccess -e 123.123.123.123 -f /var/log/httpd/access_log
只统计来自某IP的记录
# grep ^123.123.123.123 /var/log/httpd/access_log | goaccess

http://my.oschina.net/mrco/blog/181737

http://blog.chinaunix.net/uid-24250828-id-3369023.html
http://www.linuxde.net/2013/03/12943.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nginx goacess