安装好 GoAccess 后, 即便设置好日志时间格式, 还是会报错.
经过查找后发现是 Mac 用户需要声明 LANG
命令参考:
LANG="en_US.UTF-8" goaccess --no-global-config --log-format='%h - %^ [%d:%t %^] "%m %U %H" %s %b "%R" "%u" %^ "%v" "%^" %Dms' --date-format='%d/%b/%Y' --time-format='%T' --log-file=./xxxx.log --output=./xxxx.html
macOS 下 goaccess.conf 路径 1.5.5 版本为例:
/usr/local/Cellar/goaccess/1.5.5/etc/goaccess
LANG="en_US.UTF-8" goaccess xxx.log -o report.html --log-format=COMBINED
LANG="en_US.UTF-8" goaccess xxx.log -o report02.html
感谢:
https://soulteary.com/2020/12/16/log-analysis-and-processing-goaccess.html
https://www.escapelife.site/posts/df48f637.html