Skip to content

Instantly share code, notes, and snippets.

@valarpirai
Last active February 5, 2019 11:34
Show Gist options
  • Save valarpirai/cd74eab0eabdf11f657839cb235ed6a8 to your computer and use it in GitHub Desktop.
Save valarpirai/cd74eab0eabdf11f657839cb235ed6a8 to your computer and use it in GitHub Desktop.
Apache detailed log format - Print Referer, User-Agent, X-Forwarded-For
<IfModule log_config_module>
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
CustomLog logs/ssl_request_log "%h %t %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %>s %D %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\" %I %O"
</IfModule>
</IfModule>
@valarpirai
Copy link
Author

Output format:

162.158.2.8 [05/Feb/2019:11:32:06 +0000] TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 "GET / HTTP/1.1" 304 16107 - "-" "Mozilla/5.0 Chrome/70.0.3538.110 Safari/537.36" "22.18.1.6" 1250 4576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment