Wednesday 20 April 2016

Stop logging F5 probes - Apache 2

The log format for Apache to log real IP of requests on the F5 (make sure X-Forwarding is enabled) is:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" combined
To tell Apache not to log the probes from the F5 (which is needed for loadbalancing) is to have these directives:
SetEnvIf Remote_Addr IP_range_or_specific_IP dontlog
So IP_range_or_specific_IP is the regex in quotes, e.g "192\.168\.1\." for range and "192\.168\.1\.42" for IP. You will also need this setting on the statement that does the logging:
CustomLog "logs/access_log" combined env=!dontlog
Restart Apache with the graceful command.