简体   繁体   中英

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"';

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM