goaccess安装和使用(命令行、网页等)

简介:

goaccess is a free (GPL) real-time web log analyzer and interactive viewer that runs 
in a terminal in *nix systems.It provides fast and valuable HTTP statistics for system
administrators that require a visual server report on the fly.GoAccess parses the 
specified web log file and outputs the data to the X terminal.
是一个用来统计 Apache Web 服务器的访问日志的工具,速度非常快,可即时生成统计报表.

一、Debian下安装goaccess
cat /etc/debian_version 
6.0.10
apt-cache search goaccess
goaccess - log analyzer and interactive viewer for the Apache Webserver
apt-get -y install goaccess

二、Centos下安装goaccess
cat /etc/redhat-release 
CentOS release 6.6 (Final)
yum list|grep goaccess
goaccess.x86_64                            0.8.5-1.el6                   epel
yum -y install goaccess
没有epel源的话需要安装
rpm -Uvh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

三、参数说明

-b Enable total bandwidth consumption. To achieve faster parsing, 
do not enable this flag.  This has been disabled by default.(流量统计)
-f input-file path to input log filename(日志文件名)
-s Enable/report HTTP status codes. To avoid overhead while parsing, 
this has been disabled by default.(HTTP响应代码统计)
-e Exclude an IP from being count it under the HOST module. 
This has been disabled by default.(指定IP地址统计,默认禁用)
-c Prompt log/date configuration window.(配置)
-a Enable a List of User-Agents by host.(用户代理统计)

四、功能说明
1、General Statistics(统计概况,流量消耗)
Number  of valid requests, number of invalid requests, time to analyze the data, 
unique visitors, unique requested files, unique static files (css, ico, jpg,
js, swf, gif, png) unique HTTP referrers (URLs), unique 404s (not found), 
size of the parsed log file, bandwidth consumption.
2、Unique visitors(访客排名)
HTTP requests having the same IP, same date and same agent will be considered a 
unique visit. This includes crawlers.
3、Requested files(动态Web请求)
Hit totals are based on total requests. This module will display hits, percent, 
bandwidth [time served], [protocol] and [method].
4、Requested static files(静态web请求,如图片、样式表、脚本等)
Hit totals are based on total requests. Includes files such as: jpg, css, swf, js, 
gif, png etc. 
This module will display hits,percent,bandwidth,[time served],[protocol] and [method].
5、404 or Not Found(404 错误)
Hit totals are based on total requests. This module will display hits, percent, 
bandwidth, [time served], [protocol] and [method].
6、Operating Systems(操作系统)
Hit totals are based on unique visitors. This module will display hits and percent. 
The expanded module shows all available versions of the parent node.
7、Browsers(浏览器和搜索引擎)
Hit totals are based on unique visitors. This module will display hits and percent. 
The expanded module shows all available versions of the parent node.
8、HTTP Status Codes(HTTP 响应代码)
The values of the numeric status code to HTTP requests. 
Hit totals are based on total requests. This module will display hits and percent.
9、Keyphrases(键盘布局)
This  module  will report keyphrases used on Google search, Google cache, 
and Google translate. Hit totals are based on total requests. This module will dis-
play hits and percent.

五、官网
http://www.goaccess.io/ 

六、这里是在debian5.0.1上编译安装goaccess
1、下载
wget http://tar.goaccess.io/goaccess-0.9.tar.gz
或axel -n 5 http://tar.goaccess.io/goaccess-0.9.tar.gz
2、解压
tar -xzvf goaccess-0.9.tar.gz
3、configure
cd goaccess-0.9/
./configure --prefix=/opt/goaccess
4、编译并安装
make && make install
5、直接使用命令
cd /opt/goaccess/bin/
cp goaccess /usr/local/sbin/
PS:我这边将goaccess安装在/opt/goaccess目录下了。

七、命令行下如何使用

goaccess -f /var/log/apache2/aaa.access.log(当然其他nginx日志也可以的)
这个时候会弹出配置窗口:

wKioL1Vb342AaguOAAHmEUnLV1o071.jpg

我这边选NCSA Combined Log Format
之后按enter就可以了
因为每次打开都会弹出这个配置窗口,可以修改以下配置文件
cat /opt/goaccess/etc/goaccess.conf |egrep -v "^#|^$"
time-format %H:%M:%S
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
再次执行的时候就不会弹出配置窗口了
也可以通过分析指定某1天的日志
grep '17/Apr/2015' aaa_access.log|goaccess

八、网页形式展示
未完待续










本文转自 xdoujiang 51CTO博客,原文链接:http://blog.51cto.com/7938217/1651862,如需转载请自行联系原作者
相关实践学习
【涂鸦即艺术】基于云应用开发平台CAP部署AI实时生图绘板
【涂鸦即艺术】基于云应用开发平台CAP部署AI实时生图绘板
目录
相关文章
|
Docker 容器
使用阿里云 docker 镜像加速
1.创建docker daemon.json 2.添加docker镜像加速地址 3.重启守护进程
2241 1
|
监控 应用服务中间件 BI
nginx日志统计分析自动报表工具goaccess(推荐)
## 功能描述 - nginx日志统计分析自动报表工具goaccess(推荐) - 网站总访问量统计,按天统计访问量,按页面(不同URL)统计访问量(不包括JS、css),按静态页面统计访问量(包括JS、css),不存在的页面统计访问量 - 按不同的IP统计访问量,按不同的操作系统统计访问量,...
8708 0
|
9月前
|
Prometheus 监控 Cloud Native
基于docker搭建监控系统&日志收集
Prometheus 是一款由 SoundCloud 开发的开源监控报警系统及时序数据库(TSDB),支持多维数据模型和灵活查询语言,适用于大规模集群监控。它通过 HTTP 拉取数据,支持服务发现、多种图表展示(如 Grafana),并可结合 Loki 实现日志聚合。本文介绍其架构、部署及与 Docker 集成的监控方案。
829 122
基于docker搭建监控系统&日志收集
|
5月前
|
人工智能 Java 开发工具
OoderAgent 实战指南:从搭建环境到开发到开发第一个自己的skill能力
本文为 ooder SuperAgent 开源框架的实战指南,基于 MIT 协议,介绍其三层 Agent 架构(End/Route/MCP)、AI 能力标准化、P2P 服务发现及 Skillflow 编排等核心特性,并提供环境配置、技能开发、测试部署全流程实操说明。(239字)
|
7月前
|
Linux
CentOS 7 安装 unzip-6.0-21.el7.x86_64.rpm 步骤详解(附安装包)
本文详解在CentOS 7上安装unzip-6.0-21.el7.x86_64.rpm的两种方法:使用yum自动安装或rpm命令手动安装,附下载链接与详细步骤,助你快速配置解压工具。
1891 0
|
10月前
|
人工智能 编解码 安全
阿里云服务器上新,第9代AMD企业级实例g9ae,提升企业AI业务创新与性能突破
近日,阿里云推出的服务器ECS第9代AMD企业级实例-g9ae实例已开启邀测阶段,g9ae实例基于CIPU 2.0架构,搭载AMD Turin处理器,为国内首创物理核设计的“性能旗舰型”算力产品,专为AI时代企业离线数据处理打造。本文为大家介绍g9ae实例的性能及适用场景,以供了解与参考。
|
存储 安全 Apache
2023-10 适用于基于 x64 的系统的 Windows Server 2012 R2 月度安全质量汇总(KB5031419)
2023-10 适用于基于 x64 的系统的 Windows Server 2012 R2 月度安全质量汇总(KB5031419)
1817 2
|
Linux 数据安全/隐私保护
JumpServer的资产管理
文章介绍了如何使用JumpServer进行资产管理,包括创建系统用户、管理用户以及资产,并提供了操作步骤和测试连接性的指导。
669 0
JumpServer的资产管理

热门文章

最新文章