The optional useragent.log contains User-Agent header values from client requests. To use this feature, you must supply the enable-useragent-log option when running ./configure. You also must enter a pathname for the useragent_log directive. For example:
The User-Agent header normally contains a description of the agent that made the request. In most cases, the description is simply a list of product names with optional version information. You should be aware that applications can easily provide false user-agent information. Modern user-agents provide a way to customize the description. Even Squid can alter the User-Agent header in forwarded requests.
The useragent.log format is relatively simple. It looks like this:
188.8.131.52 [05/Nov/2003:08:51:43 -0700] "Mozilla/5.0 (compatible; Konqueror/3; FreeBSD)" 184.108.40.206 [05/Nov/2003:08:52:18 -0700] "Opera/7.21 (X11; FreeBSD i386; U) [en]" 220.127.116.11 [05/Nov/2003:08:55:11 -0700] "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/103u (KHTM..." 18.104.22.168 [05/Nov/2003:08:51:43 -0700] "Java1.3.1_01" 22.214.171.124 [05/Nov/2003:08:52:50 -0700] "Googlebot/2.1 (http://www.googlebot.com/bot.html)" 126.96.36.199 [05/Nov/2003:08:52:50 -0700] "WebZIP/4.1 (http://www.spidersoft.com)" 188.8.131.52 [05/Nov/2003:08:52:50 -0700] "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; Hotbar 3.0)" 184.108.40.206 [05/Nov/2003:08:54:40 -0700] "Bookmark Renewal Check Agent [http://www.bookmark.ne.jp/] (Version 2.0..."
Unlike the other log files, it has just three fields:
The same as the client address in access.log. The log_fqdn and client_netmask directives affect this log file as well.
Unlike the other log files, which represent the time as seconds since the Unix epoch, this one uses a human-readable format. It is the HTTP common log-file format timestamp, which looks like this:
Note that the square brackets delimit the timestamp, which includes a space character. Also note that, like referer.log, these entries are created as soon as Squid receives the complete request.
The value of the User-Agent header. These strings almost always contain whitespace. Squid doesn't encode User-Agent values before writing them in this log file.