Goaccess: Verify your log/date/time format

Created on 6 Apr 2020  Â·  7Comments  Â·  Source: allinurl/goaccess

lodattime format question

All 7 comments

goaccess -f access.log -o /var/www/html/index.html --real-time-html --log-format='%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"' --date-format='%d/%b/%Y' --time-format='%H:%M:%S' --enable-panel=REFERRERS --enable-panel=KEYPHRASES

I am trying to run this but it's showing me this "Token '[05/Aug/2017:13:23:21' doesn't match with secifier '%t' "

Please post a few sample lines directly from your access log.

Hi guys same issue for me

time-format %H:%M:%S
date-format %d/%b/%Y
log-format "%h , PID:%P , %l , %u , %t , First request line:\"%r\" , URL:\"%{Referer}i\" , Client:\"%{User-agent}i\" , Status:%>s , size:%bB"

few lines from log

10.128.0.93 , PID:19675 , - , - , [17/Apr/2020:09:54:35 +0000] , First request line:"GET /k/valeo_loadfpm/./common/home.php HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/protected/login.php" , Client:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063" , Status:200 , size:6314B
10.128.0.93 , PID:19675 , - , - , [17/Apr/2020:09:54:35 +0000] , First request line:"POST /k/valeo_loadfpm/common/record_callback.php HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/common/record3.php?rkey=SUPPLIERID&" , Client:"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0" , Status:200 , size:5061B
10.128.0.93 , PID:19591 , - , - , [17/Apr/2020:09:54:35 +0000] , First request line:"POST /k/valeo_loadfpm/common/record_callback.php HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/common/record_edit.php?rkey=REQUESTID&rid=4045123&REQUESTID=4045123&MM_Edit=0&bat=4816b2a05c13973ffcc938a4fbdbb85e&_token=NzkyNzg0MDAwM2MyZWNiMDZhYzE5NjczMTFmMzk1MTkyNTFhOTIzODc1MGU5ODA4&" , Client:"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0" , Status:200 , size:2502B
10.128.0.93 , PID:19591 , - , - , [17/Apr/2020:09:54:35 +0000] , First request line:"GET /k/valeo_loadfpm/common/record3.php?rkey=ORDERID HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/common/record3.php?rkey=REQUESTID&" , Client:"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0" , Status:200 , size:12233B
10.128.0.93 , PID:27018 , - , - , [17/Apr/2020:09:54:35 +0000] , First request line:"GET /k/valeo_loadfpm/common/record_edit.php?rkey=ORDERID&MM_edit=0&rid=2002870&ORDERID=2002870&bat=ca72a3c64b6c84a1ce4351366d28b1f5&_token=OGMxZGY5MDliZjllNjI3ODNjOGUwMzNlZmRkMjVmYWMyNDFjMjYwYjJkYjczMTE5 HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/common/record3.php?rkey=ORDERID&" , Client:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0" , Status:200 , size:30438B
10.128.0.93 , PID:19591 , - , - , [17/Apr/2020:09:54:36 +0000] , First request line:"POST /k/valeo_loadfpm/common/record_edit.php HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/common/record_edit.php?rkey=REQUESTID&rid=4045125&REQUESTID=4045125&MM_Edit=0&bat=b2f92b2cdd8dfa1e7032ffaf17be846e&_token=YWU3YWM0ZGVmOGQ5ZmQ1Mzc1ZWU0ODJhZDhlZDE3YzU3ZjRhOTE2Mjg2YjIzMWQw&" , Client:"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0" , Status:200 , size:2403B
10.128.0.93 , PID:19591 , - , - , [17/Apr/2020:09:54:36 +0000] , First request line:"GET /k/valeo_loadfpm/common/record3.php?rkey=REQUESTID&SetSTATUS=sent&Display=inapproval&_token=YTcyN2UzYTZkMWE4MTBjMTFhOGRjMDdmODNkZDg5ZjkxMTJkYTg2NDgxOTNlNGYy HTTP/1.1" , URL:"https://loadtestfpmba.determine.com/k/valeo_loadfpm/common/home.php?menu=home" , Client:"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0" , Status:200 , size:11847B

Hi,

I had the same issue but I resolved it by just adding export LC_ALL=C.UTF-8

For the story I'm French, on my macOS the language and date format for my account is set to be in English but it seems that somehow (maybe in strptime?) the setting is ignored or maybe that the primary system language used during the OS installation was not the English. The first workaround was to translate in French all abbreviated months in the logs but that was too annoying, exporting LC_ALL before launching the binary solved the issue, at least for me.

You can always try setting the time env.

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

You saved my night !

LC_TIME="en_US.UTF-8" bash -c 'goaccess -f access.log.3 --config-file=goaccess.rc -o report.html'

did the job

my goaccess.rc config file

# 118.1.XXX.XXX - - [04/Dec/2020:06:25:43 +0100] "GET /…"
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
date-format %d\/%b\/%Y
time-format %H:%M:%S

My environnement : Mac OS X Mojave 10.14.6 + GoAccess 1.4.3 via Brew

Closing this. Feel free to reopen it if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

securixhk picture securixhk  Â·  3Comments

deosha picture deosha  Â·  3Comments

SergioDG-YCC picture SergioDG-YCC  Â·  3Comments

g33kphr33k picture g33kphr33k  Â·  3Comments

Tassleh0ff picture Tassleh0ff  Â·  4Comments