GoAccess should be configured for real-time log analytics with controlled report exposure. Proper configuration is essential for optimal performance and security.
GoAccess looks for configuration files in the following order:
$HOME/.goaccessrc/etc/goaccess/goaccess.conf/usr/local/etc/goaccess/goaccess.confCreate /etc/goaccess/goaccess.conf with the following settings:
# Log format settings
log-format COMBINED
time-format %H:%M:%S
date-format %d/%b/%Y
# Input/Output settings
log-file /var/log/nginx/access.log
output /var/www/goaccess/index.html
# Real-time HTML report settings
real-time-html true
ws-url wss://goaccess.example.com/ws
port 7890
# Performance settings
max-items 100
hl-header on
color-scheme 2
# Privacy settings
no-query-string yes
no-ip-validation yes
# GeoIP settings (if enabled)
geoip-database /usr/share/GeoIP/GeoLite2-City.mmdb
When using Docker, you can configure GoAccess using environment variables:
GOACCESS_LOG_FILE=/var/log/nginx/access.log
GOACCESS_OUTPUT=/var/www/goaccess/index.html
GOACCESS_REAL_TIME_HTML=true
GOACCESS_WS_URL=wss://goaccess.example.com/ws
GOACCESS_TIME_FORMAT=%H:%M:%S
GOACCESS_DATE_FORMAT=%d/%b/%Y
GOACCESS_LOG_FORMAT=COMBINED
log-format COMBINED
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
date-format %d/%b/%Y
time-format %H:%M:%S
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %^ %^
date-format %d/%b/%Y
time-format %H:%M:%S
# Limit the number of items displayed per panel
max-items 100
# Process logs in parallel (requires --jobs flag)
# Use with caution as it increases memory usage
# jobs 4
# Enable data persistence across restarts
persist true
restore true
# Process logs in chunks for better performance
# chunk-size 8192
# Strip query strings from URIs
no-query-string yes
# Hide IP addresses completely
anonymize-ip yes
# Ignore crawlers/bots
ignore-crawlers yes
# Hide referrer header
hide-referer no
# Skip certain status codes
skip-statics 200
# Path to GeoLite2 City database (requires GeoIP2 support)
geoip-database /usr/share/GeoIP/GeoLite2-City.mmdb
# Enable ASN lookup (requires GeoIP2 ASN database)
# asn-database /usr/share/GeoIP/GeoLite2-ASN.mmdb
Back up metadata database(s), event storage, and configuration/secrets metadata. Validate restore with one ingestion path, one dashboard/query, and one export/report check.
For persistent data, regularly backup:
--persist option)Any questions?
Feel free to contact us. Find all contact information on our contact page.