Skip to content

Instantly share code, notes, and snippets.

@alexishida
Created September 6, 2019 16:59
Show Gist options
  • Save alexishida/1004a0600b02f4acd5a2bfa244cd453a to your computer and use it in GitHub Desktop.
Save alexishida/1004a0600b02f4acd5a2bfa244cd453a to your computer and use it in GitHub Desktop.
GoAccess NCSA Combined Log Format with Virtual Host NGINX
# NCSA Combined Log Format with Virtual Host
# nginx.conf
# https://goaccess.io/man#interactive-keys
log_format vcombined '$host:$server_port '
'$remote_addr $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log vcombined;
# Log
goaccess access.log --log-format='%v %h - %^[%d:%t %^] "%r" %s %b "%R" "%u"' --date-format=%d/%b/%Y --time-format=%T -o report.html
# Realtime log
goaccess access.log --log-format='%v %h - %^[%d:%t %^] "%r" %s %b "%R" "%u"' --date-format=%d/%b/%Y --time-format=%T -o report.html --real-time-html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment