执行命令 `goaccess -a -d -f www.xxxx.com_access_2021-11-09_145601.log -o ~/Downloads/go-access.html` 报以下错误: 作者: Chuwen 时间: 2021-11-09 分类: Linux 评论 ### 执行命令 `goaccess -a -d -f www.xxxx.com_access_2021-11-09_145601.log -o ~/Downloads/go-access.html` 报以下错误: ``` ➜ Downloads goaccess -a -d -f www.xxxx.com_access_2021-11-09_145601.log -o ~/Downloads/go-access.html [SETTING UP STORAGE www.xxxxxx.com_access_2021-11-09_145601.log] {0} @ {0/s} ==47696== GoAccess - Copyright (C) 2009-2020 by Gerardo Orellana ==47696== https://goaccess.io - ==47696== Released under the MIT License. ==47696== ==47696== FILE: www.xxxxxxxx.com_access_2021-11-09_145601.log ==47696== 已解析 10 行 出现以下错误: ==47696== ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== Token '08/Nov/2021' doesn't match specifier '%d' ==47696== ==47696== 格式错误 - 请检查你的日志/日期/时间格式 ``` ### `~/.goaccessrc` 配置文件内容 ``` time-format %H:%M:%S date-format %d/%b/%Y log-format %h %^[%d:%t %^] "%r" %s %b ``` ### 解决方案 参考:https://github.com/allinurl/goaccess/issues/1563 将语言环境变量设置为英语即可 ``` LANG="en_US.UTF-8" goaccess -a -d -f www.xxxx.com_access_2021-11-09_145601.log -o ~/Downloads/go-access.html # 或者 LANG="en_US.UTF-8" bash -c 'goaccess -a -d -f www.xxxx.com_access_2021-11-09_145601.log -o ~/Downloads/go-access.html' ```