On Wed, 08 Oct 2008 14:32:26 +0200 André Warnier <[EMAIL PROTECTED]> wrote:

> Hi.
>
> Following a message posted on the Apache users list, I am just curious
> if via mod_perl there could be a solution to the following issue :
>
> A busy Apache server (with several VirtualHosts, why not ?) is being
> accessed from internal network clients (IP address 192.168.*) as well
> as by external clients (any other IPs).
> Among the internal clients are some GoogleBots, which generate
> thousands of accesses, all logged in the access logs of the hosts.
> These accesses come to generate more than 90% of the total, which
> really bothers the sysadmins when they have to scan any logfile for
> something else.
>
> Would there be any way, using mod_perl, to detect such accesses early,
> and to either cancel the log phase for them, or else redirect the
> logging to some sink file, or else at least set some parameter so that
> the verbosity of the log for these accesses would be drastically
> reduced ?

You can do this without involving mod_perl. Simply use one of the
directives SetEnvIf or BrowserMatch to detect these bots and set a
variable like 'is_googlebot', and then use a conditional log-statement:

 CustomLog .... env=!is_googlebot

See also: 
    http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html
    http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog

 - Vegard V -

Reply via email to