/Nginx-2-Goaccess-Log-Format-Converter

Convert Nginx log_format to goaccess config file

Primary LanguageShell

nginx2goaccess

Convert Nginx log_format to goaccess config.

Usage

Command:

Usage: ./nginx2goaccess.sh '<log_format>'

./nginx2goaccess.sh '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'

Result:

  • Can be used with -p and read from a config file or placed into ~/.goaccessrc
- Generated goaccess config:

time-format %T
date-format %d/%b/%Y
log_format %h - %^ [%d:%t %^] "%r" %s %b "%R" "%u"