Goaccess: Token '23/Nov/2019' doesn't match specifier '%d'

Created on 23 Nov 2019  路  3Comments  路  Source: allinurl/goaccess

nginx: 1.16.1

goaccess: 1.3_1

image

nginx access log format:

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

nginx access log example:

127.0.0.1 - - [23/Nov/2019:11:45:04 +0800] "GET /hadoop-project-dist/hadoop-hdfs/WebHDFS.html HTTP/1.0" 200 125430 "http://localhost:9000/hadoop-hdfs-httpfs/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36" "127.0.0.1"

error message

$ /usr/local/Cellar/goaccess/1.3_1/bin/goaccess logs/access.log -o /Users/destiny/dev/nginx/logs/report.html --time-format='%T' --date-format='%d/%b/%Y' --log-format='%h - %^ [%d:%t %^] "%r" %s %b "%R" "%u" "%^"'

Token '23/Nov/2019' doesn't match specifier '%d'
i18n log-processing lodattime format question

Most helpful comment

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'

All 3 comments

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'

sometimes you have to use a bit different command:
LC_ALL="en_US.UTF-8" bash -c 'goaccess access.log --log-format=COMBINED'

explained in:
https://github.com/allinurl/goaccess/issues/1669

@majkelo Thanks for pointing that out. Closing this. @DestinyWang feel free to reopen it if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gill-Bates picture Gill-Bates  路  3Comments

canepa picture canepa  路  3Comments

tbarbette picture tbarbette  路  3Comments

g33kphr33k picture g33kphr33k  路  3Comments

eroldru picture eroldru  路  3Comments