How to log GoogleBot useragent in its own access log?

Phillip Oldham phill at activityhq.com
Thu Mar 4 11:22:52 MSK 2010


On 03/03/2010 22:12, David Taveras wrote:
> Would it be possible to match if the useragent contains this string
> "+http://www.googlebot.com/bot.html"  and log it in a specific file
> for googles crawling?
>    

Have you tried just using an if statement? Something like...

access_log /my/usual/access/log;

if ( $http_user_agent ~= "googlebot" ) {
access_log /my/googlebot/log;
}

-- 

*Phillip B Oldham*
ActivityHQ
phill at activityhq.com <mailto:phill at theactivitypeople.co.uk>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named 
recipient(s) only and may be confidential. If they have come to you in 
error, please reply to this e-mail and highlight the error. No action 
should be taken regarding content, nor must you copy or show them to anyone.

This e-mail has been created in the knowledge that Internet e-mail is 
not a 100% secure communications medium, and we have taken steps to 
ensure that this e-mail and attachments are free from any virus. We must 
advise that in keeping with good computing practice the recipient should 
ensure they are completely virus free, and that you understand and 
observe the lack of security when e-mailing us.

------------------------------------------------------------------------



More information about the nginx mailing list