Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 10.15 nginx access_log Token doesn't match specifier '%d #1571

Closed
huxxhua opened this issue Oct 16, 2019 · 2 comments
Closed

macOS 10.15 nginx access_log Token doesn't match specifier '%d #1571

huxxhua opened this issue Oct 16, 2019 · 2 comments

Comments

@huxxhua
Copy link

huxxhua commented Oct 16, 2019

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 ! :)

@allinurl
Copy link
Owner

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'

@huxxhua
Copy link
Author

huxxhua commented Oct 17, 2019

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants