Capturing Google Bot entries from Apache Web log file

Q

How to capture the Google Bot from Web log file?

Here are some Web log file entries:

✍: Guest

A

Google Bot is a web crawler from Google that obtains content for the Google Search engine. Google Bot uses the following user agent string:

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

The regular expression to capture Google Bot entries from Apache Web log file can be written as: with the multiple lines modifier "m" specified:

Click the button to test this regular expression here online:

2013-02-04, 0👍, 0💬