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

Format error-please check your log / date / time format due to locale #1697

Closed
ychunc opened this issue Mar 9, 2020 · 3 comments
Closed

Comments

@ychunc
Copy link

ychunc commented Mar 9, 2020

time-format %H:%M:%S
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"

Token '09/Mar/2020' doesn't match specifier '%d'

 127.0.0.1 - - [09/Mar/2020:14:01:24 +0800] "GET /test/nginx_log.html HTTP/1.1" 200 331225 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36" "-"

No reason found🤢

@allinurl
Copy link
Owner

Please use the following, I'm guessing your log has English dates and your machine has a different locale.

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

@allinurl allinurl changed the title Format error-please check your log / date / time format Format error-please check your log / date / time format due to locale Mar 10, 2020
@Globulopolis
Copy link

@allinurl same issue on Windows platform with non-english locale. Can we somehow fix it without adding LANG and changing default location in Windows?

@allinurl
Copy link
Owner

@Globulopolis goaccess uses strptime strftime to perform date stuff. The issue here is that the server is logging the date in English so I guess we could let the user set the locale as a command line option? which essentially LANG is doing.

Closing this, feel free to create a new issue if needed. Thanks

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

3 participants