使用goaccess分析nginx访问日志
goaccess介绍官网: https://goaccess.io/GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.It provides fast and valu
goaccess介绍
GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly.
简单来说goaccess是一个可以可视化分析本地nginx日志的工具, 可以在命令行终端或者使用web界面进行查看, 相当方便.
安装
Ubuntu中可以直接用apt安装
$ sudo apt-get install goaccess
CentOS中需要手动下载和编译
$ wget https://tar.goaccess.io/goaccess-1.4.2.tar.gz
$ tar -xzvf goaccess-1.4.2.tar.gz
$ cd goaccess-1.4.2/
$ ./configure --enable-utf8 --enable-geoip=legacy
$ make
$ sudo make install
默认安装后的可执行文件位置/usr/local/bin/goaccess
使用方法
$ sudo goaccess /var/log/nginx/access.log
nginx的访问日志使用第一个NCSA Combined Log Format
格式就行(空格选中, 回车确认)
分类统计
1 - Unique visitors per day - Including spiders
每天唯一访问用户(包含爬虫)
2 - Requested Files (URLs)
请求文件(URL地址)
3 - Static Requests
静态文件请求(js/css/图片)
4 - Not Found URLs (404s)
404错误地址
5 - Visitor Hostnames and IPs
访问用户主机名/IP地址
6 - Operating Systems
访问用户所使用操作系统
7 - Browsers
访问用户所使用浏览器
8 - Time Distribution
访问时间分布
11 - Referring Sites
请求来源
13 - HTTP Status Codes
HTTP状态代码
16 - Geo Location
访问IP所属地理位置
键盘操作
- 上下箭头用来逐行翻动
- Tab切换分类
- 回车进入当前分类详细页面
- 详细页面中使用
j
和k
进行上下翻动 q
关闭详细页面
更多推荐
所有评论(0)