Squid log format
From Wikitech
(Difference between revisions)
m (cat) |
|||
| (5 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
The Wikimedia squid log format is a custom format which uses the logformat directive available in Squid 2.6. The %sn format code is our extension. [http://www.squid-cache.org/mail-archive/squid-dev/200701/0042.html] For more information about our squid log setup, see [[Squid logging]]. | The Wikimedia squid log format is a custom format which uses the logformat directive available in Squid 2.6. The %sn format code is our extension. [http://www.squid-cache.org/mail-archive/squid-dev/200701/0042.html] For more information about our squid log setup, see [[Squid logging]]. | ||
| − | $hostname %sn %{%Y-%m-%dT%H:%M:%S}tg.%03tu %tr %>a %Ss/%03Hs %<st %rm %ru %Sh/%<A %mt %{Referer}>h %{X-Forwarded-For}>h %{User-Agent}>h | + | $hostname %sn %{%Y-%m-%dT%H:%M:%S}tg.%03tu %tr %>a %Ss/%03Hs %<st %rm %ru %Sh/%<A %mt %{Referer}>h %{X-Forwarded-For}>h %{User-Agent}>h %{X-CS}>h |
| − | Field indexes when | + | Field indexes when tab-separated: |
# Hostname of the squid | # Hostname of the squid | ||
| Line 19: | Line 19: | ||
# [http://en.wikipedia.org/wiki/X-Forwarded-For X-Forwarded-For header] | # [http://en.wikipedia.org/wiki/X-Forwarded-For X-Forwarded-For header] | ||
# User-Agent header | # User-Agent header | ||
| + | # Accept_Language | ||
| + | # X-CS (Wikipedia Zero MCC-MNC Carrier Code) | ||
| + | |||
Sample line, with the client IP address replaced with 1.2.3.4 to protect the innocent: | Sample line, with the client IP address replaced with 1.2.3.4 to protect the innocent: | ||
| − | + | ||
| − | sq18.wikimedia.org 1715898 | + | sq18.wikimedia.org 1715898 2010-12-01T21:57:22.331 0 1.2.3.4 TCP_MEM_HIT/200 13208 GET http://en.wikipedia.org/wiki/Main_Page NONE/- text/html - - Mozilla/4.0%20(compatible;%20MSIE%206.0;%20Windows%20NT%205.1;%20.NET%20CLR%201.1.4322) en-US - |
| − | + | ||
| + | |||
| + | Note: Make sure the packet ends in an endline \n | ||
[[Category:Squid]] | [[Category:Squid]] | ||
[[Category:Help]] | [[Category:Help]] | ||
Latest revision as of 22:40, 31 January 2013
The Wikimedia squid log format is a custom format which uses the logformat directive available in Squid 2.6. The %sn format code is our extension. [1] For more information about our squid log setup, see Squid logging.
$hostname %sn %{%Y-%m-%dT%H:%M:%S}tg.%03tu %tr %>a %Ss/%03Hs %<st %rm %ru %Sh/%<A %mt %{Referer}>h %{X-Forwarded-For}>h %{User-Agent}>h %{X-CS}>h
Field indexes when tab-separated:
- Hostname of the squid
- Sequence number
- The current time in ISO 8601 format (plus milliseconds), according to the squid server's clock.
- Request service time in ms
- Client IP
- Squid request status, HTTP status code
- Reply size including HTTP headers
- Request method (GET/POST etc)
- URL
- Squid hierarchy status, peer IP
- MIME content type
- Referer header
- X-Forwarded-For header
- User-Agent header
- Accept_Language
- X-CS (Wikipedia Zero MCC-MNC Carrier Code)
Sample line, with the client IP address replaced with 1.2.3.4 to protect the innocent:
sq18.wikimedia.org 1715898 2010-12-01T21:57:22.331 0 1.2.3.4 TCP_MEM_HIT/200 13208 GET http://en.wikipedia.org/wiki/Main_Page NONE/- text/html - - Mozilla/4.0%20(compatible;%20MSIE%206.0;%20Windows%20NT%205.1;%20.NET%20CLR%201.1.4322) en-US -
Note: Make sure the packet ends in an endline \n