This is a small query tool for webserver logs. By formatting the log entries as prolog facts, we can use the logs as a database.
- Enable the GeoIP module
- Create a log format
log_format prolog 'l("$server_name", "$remote_addr", $status, "$time_local", "$request_method", "$request_uri", "$geoip_country_code").';
- Use the log format
access_log /var/log/nginx/access.log prolog;