Switch language
zh
Switch theme
Light
  • goaccess export nginx access log to report

    使用 goaccess 将 nginx access.log 生成可视化 report.html goaccess github地址 nginx access.log 过滤 # 过滤不统计的日志(如图片、js、css、恶意访问的 login、404 等) cat access.log | grep -vE '(\.css|\.js|\.jpg|\.png|\.gif|\.ico|\.jfif|\.woff|\.woff2|\.eot|\.ttf|\.svg|\.map|bot|Bot|favicon|404|curl|Java|scaninfo|phpMyAdmin|\.env|admin|login|python|http\-client|wp\-|post|POST|\.php|api|ajax|ads\.txt|humans\.txt|well\-known|security\.txt|CONNECT|Head)' > new.log # 只统计 GET 请求 cat new.log | grep 'GET' > new2.log # 只统计 GET 首页的请求 cat new2.log | grep 'GET /' > new3.log goaccess 操作步骤 linux 环境(编译/包管理器)安装 goaccess, 编译安装注意要 --enable-utf8 --enable-geoip=mmdb /etc/goaccess/goaccess.conf 配置 ## 2.1 打开 nginx time-format, date-format, log-format # Apache/NGINX's log formats below. time-format %H:%M:%S # Apache/NGINX's log formats below.
🍀