Hello,
I am trying to configure (in the config file) this type of log:
2019/12/06 08:16:01 my.domain.com 192.168.1.1 - - [06/Dec/2019:08:16:01 +0100] "GET /redirect.html?count=0.7408056120261262 HTTP/2.0" 200 548 "https://my.domain.com/" "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36" 3
2019/12/06 08:24:42 my.domain.com 218.66.77.11 - - [06/Dec/2019:08:24:42 +0100] "GET /redirect.html?count=0.22918624993826597 HTTP/2.0" 200 548 "-" "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36" 2
2019/12/06 17:36:54 my.domain.com 226.238.137.251 - - [06/Dec/2019:17:36:54 +0100] "GET /cgi-bin/login.html?1575650214 HTTP/1.1" 200 2653 "https://my.domain.com/redirect.html?count=0.282681040591797" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" 3
On Caddy the log is set to "{hostonly} {combined} {latency_ms}", but I do not know how to translate it to make it readable to goaccess.
How should I set it to work on goaccess.conf?
Thanks!
I somehow arrived to do so, but it still does not work:
log-format %d %t %v %h %^[%d/%b/%Y:%t %^] "%r" %s %b "%R" "%u" %^
date-format %Y/%b/%d
time-format %H:%M:%S
enable-panel REFERRERS
enable-panel KEYPHRASES
Any help would be really appreciated, as I am not good with log syntax.
Thanks!
Can you please describe what's the last field? Thanks
Thanks @allinurl , I think it is {latency_ms}, but I don't know if it is really necessary to keep it.
Reading here[1], it seems to correspond to %L. Correct?
Moreover, I see that in the log above there are two date standard used..
[1] https://lemanchet.fr/articles/optimizing-caddy-logs-for-goaccess.html
Hi @allinurl can you please have a look at the above? 1000 kudos!
EDIT: I managed to go one step further, but it still does not work:
````
log-format %Y/%m/%d %t %v %h %^[%d/%b/%Y:%t %^] "%r" %s %b "%R" "%u" %L
time-format %H:%M:%S
enable-panel REFERRERS
enable-panel KEYPHRASES
EDIT2: in case it may be useful, this is the entire config file:
port 7890
daemonize true
log-format %Y/%m/%d %t %v %h %^[%d/%b/%Y:%t %^] "%r" %s %b "%R" "%u" %L
time-format %H:%M:%S
enable-panel REFERRERS
enable-panel KEYPHRASES
real-time-html true
output /share/Web/goaccess/index.html
ws-url wss://wss.mydomain.com:443
-log-file /share/Public/accesslogs/NAS1.log
-log-file /share/Public/accesslogs/NAS2.log
geoip-database /share/Public/GeoIP/GeoLite2-City.mmdb
agent-list true
````
Hi @allinurl , I apologise for chasing you, but am I on a bad track? Could you please help me out? Thanks a bunch!
This should work:
goaccess log --log-format='%d %t %v %h %^[%^] "%r" %s %b "%R" "%u" %L' --date-format=%Y/%m/%d --time-format=%T
Indeed it works, thanks!
I only see the "keyphrases from Google's search" tab empty, but I think it is because the info is not available in the log.
Most helpful comment
This should work: