Goaccess: macOS 10.15 nginx access_log Token doesn't match specifier '%d

Created on 16 Oct 2019  Â·  2Comments  Â·  Source: allinurl/goaccess

Hello,

I keep on getting this error no matter what I do:

Token '16/Oct/2019' doesn't match specifier '%d'

The command I am using is:
goaccess test.nginx.com.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format=COMMON

I tried other methods and it was the same error.example:
goaccess test.nginx.com.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format='%h %^[%d:%t %^] "%r" %s %b "%R" "%u"'

An example log file line:
127.0.0.1 - - [16/Oct/2019:10:43:04 +0800] "GET /report.html HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" "-"

In addition,the output of date my terminal is :
2019年10月16日 星期三 11时04分36秒 CST

Thanks in advance ! :)

log-processing question

Most helpful comment

Looks like your access log has english dates while your system locale is set to Chinese.

LANG="en_US.UTF-8" bash -c 'goaccess access.log --log-format=COMBINED'

All 2 comments

Looks like your access log has english dates while your system locale is set to Chinese.

LANG="en_US.UTF-8" bash -c 'goaccess access.log --log-format=COMBINED'

it work!
I added itLANG="en_US.UTF-8" in front of the command line.

The command I am using is:
LANG="en_US.UTF-8" bash -c 'goaccess test.nginx.com.log -o ../html/report.html --real-time-html --time-format='%H:%M:%S' --date-format='%d/%b/%Y' --log-format=COMMON'

Maybe the system language affects the match

anyway,Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ychunc picture ychunc  Â·  3Comments

olimpo88 picture olimpo88  Â·  3Comments

SerenaAi picture SerenaAi  Â·  3Comments

LoanDEV picture LoanDEV  Â·  3Comments

vivekkrish picture vivekkrish  Â·  3Comments