Goaccess: Help on custom log

Created on 6 Dec 2019  路  7Comments  路  Source: allinurl/goaccess

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!

lodattime format question

Most helpful comment

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

All 7 comments

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

date-format %Y/%m/%d

time-format %H:%M:%S
enable-panel REFERRERS
enable-panel KEYPHRASES
EDIT2: in case it may be useful, this is the entire config file:

The port to which the connection is being attempted to connect.

port 7890

Run GoAccess as daemon (if --real-time-html enabled).

daemonize true

Log format type

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

Enable real-time HTML output.

real-time-html true

Write output to stdout given one of the following files and the

corresponding extension for the output format:

output /share/Web/goaccess/index.html

websocket connection

ws-url wss://wss.mydomain.com:443

Specify the path to the input log file. If set, it will take

priority over -f from the command line.

-log-file /share/Public/accesslogs/NAS1.log
-log-file /share/Public/accesslogs/NAS2.log

GeoIP Options

geoip-database /share/Public/GeoIP/GeoLite2-City.mmdb

Enable a list of user-agents by host. For faster parsing, do not

enable this flag.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

domainoverflow picture domainoverflow  路  3Comments

Tassleh0ff picture Tassleh0ff  路  4Comments

securixhk picture securixhk  路  3Comments

tbarbette picture tbarbette  路  3Comments

Gill-Bates picture Gill-Bates  路  3Comments