nginxlogginggoaccess

GoAccess nginx logformat unknown


Just installed GoAccess and I want extract data from my log, but I can't understand the right *format :(

Here one sample segment from my log:

Aug 26 09:20:39 host remote_addr: [0.000 - .] - testdomain.com - 10.00.123.123, 69.22.1.34 - - [26/Aug/2020:09:20:39 +0200]  "GET /media/image.jpg HTTP/1.1" 304 0 "https://testdomain.com/test.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"

nginx conf:

log_format main '[$request_time $upstream_response_time $pipe] - $host - $remote_addr - $remote_user [$time_local]  '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';

Solution

  • Solved in this way:

    date-format %d/%b/%Y

    time-format %H:%M:%S

    log-format [%T %^ %^] - %v - ~h{, } - %e [%d:%t %^] - - "%r" %s %b "%R" "%u"