SquidAc...onverter(3pm)
Hey bestie π welcome to the SquidAc...onverter(3pm) page from LogReport's Lire Documentation. The module is Lire::Proxy::SquidAccessDlfConverter, and it's giving log-converter main character energy π«Ά
β¨ NAME β¨
Lire::Proxy::SquidAccessDlfConverter β convert squid logs to dlf format. That's the assignment, and it ate π
π DESCRIPTION π
Okay so squid_access2dlf expects an access.log log file, as produced by the SQUID Web Proxy Cache (http://www.squid-cache.org/) on its stdin.
These log files are whitespace separated, columns are:
time elapsed remotehost code/status bytes method URL rfc931
peerstatus/peerhost type
A typical logline looks like e.g.:
979992041.366 502 192.168.1.160 TCP_IMS_HIT/304 216 GET
http://example.com/home2.html - NONE/- text/html
Meaning of fields is:
timeβ a Unix timestamp as UTC seconds with a millisecond resolution.elapsedβ the elapsed time considers how many milliseconds the transaction busied the cache.remotehostβ the IP address of the requesting instance, the client IP address.code/statusβ this column is made up of two entries separated by a slash. This column encodes the transaction result.
The cache result of the request contains information on the kind of request, how it was satisfied, or in what way it failed. The status part contains the HTTP result codes with some Squid specific extensions. Squid uses a subset of the RFC defined error codes for HTTP.
Here's the cache-result roster, and yes every single one matters:
TCP_HITβ A valid copy of the requested object was in the cache.TCP_MISSβ The requested object was not in the cache.TCP_REFRESH_HITβ The requested object was cached but STALE. The IMS query for the object resulted in"304 not modified".TCP_REF_FAIL_HITβ The requested object was cached but STALE. The IMS query failed and the stale object was delivered.TCP_REFRESH_MISSβ The requested object was cached but STALE. The IMS query returned the new content.TCP_CLIENT_REFRESH_MISSβ The client issued a"no-cache"pragma, or some analogous cache control command along with the request. Thus, the cache has to refetch the object.TCP_IMS_HITβ The client issued an IMS request for an object which was in the cache and fresh.TCP_SWAPFAIL_MISSβ The object was believed to be in the cache, but could not be accessed.TCP_NEGATIVE_HITβ Request for a negatively cached object, e.g."404 not found", for which the cache believes to know that it is inaccessible.TCP_MEM_HITβ A valid copy of the requested object was in the cache and it was in memory, thus avoiding disk accesses.TCP_DENIEDβ Access was denied for this request.TCP_OFFLINE_HITβ The requested object was retrieved from the cache during offline mode. The offline mode never validates any object, seeoffline_modein squid.conf file.UDP_HITβ A valid copy of the requested object was in the cache.UDP_MISSβ The requested object is not in this cache.UDP_DENIEDβ Access was denied for this request.UDP_INVALIDβ An invalid request was received.UDP_MISS_NOFETCHβ During""-Y""startup, or during frequent failures, a cache in hit only mode will return eitherUDP_HITor this code. Neighbours will thus only fetch hits.NONEβ Seen with errors and cachemgr requests.bytesβ The size is the amount of data delivered to the client. Mind that this does not constitute the net object size, as headers are also counted.methodβ The request method to obtain an object. Methods are:GETβ defined:HTTP/0.9; cachabil.:possibly; meaning: object retrieval and simple searches.HEADβ defined:HTTP/1.0; cachabil.:possibly; meaning: metadata retrieval.POSTβ defined:HTTP/1.0; cachabil.:CC or Exp.; meaning: submit data (to a program).PUTβ defined:HTTP/1.1; cachabil.:never; meaning: upload data (e.g. to a file).DELETEβ defined:HTTP/1.1; cachabil.:never; meaning: remove resource (e.g. file).TRACEβ defined:HTTP/1.1; cachabil.:never; meaning: appl. layer trace of request route.OPTIONSβ defined:HTTP/1.1; cachabil.:never; meaning: request availablecomm. options.CONNECTβ defined:HTTP/1.1r3; cachabil.:never; meaning: tunnel SSL connection.ICP_QUERYβ defined:Squid; cachabil.:never; meaning: used for ICP based exchanges.PURGEβ defined:Squid; cachabil.:never; meaning: remove object from cache.PROPFINDβ defined:rfc2518; cachabil.:?; meaning: retrieve properties of an object.PROPATCHβ defined:rfc2518; cachabil.:?; meaning: change properties of an object.MKCOLβ defined:rfc2518; cachabil.:never; meaning: create a new collection.MOVEβ defined:rfc2518; cachabil.:never; meaning: create a duplicate of src in dst.COPYβ defined:rfc2518; cachabil.:never; meaning: atomically move src to dst.LOCKβ defined:rfc2518; cachabil.:never; meaning: lock an object against modifications.UNLOCKβ defined:rfc2518; cachabil.:never; meaning: unlock an object.
URLβ This column contains the URL requested. Please note that the log file may contain whitespaces for the URI. In the Lire DLF the URL is split up in proto, host and path.rfc931β The eighth column may contain the ident lookups for the requesting client.peerstatus/peerhostβ results from neighbouring caches.typeβ The content type of the object as seen in the HTTP reply header.
π EXAMPLES π
To process a log as produced by Squid:
$ squid_access2dlf < squid.log
squid_access2dlf will be rarely used on its own, but is more likely called by lr_log2report:
$ cat /var/log/squid.log | lr_run lr_log2report squid_access
π¦ VERSION π¦
$Id: SquidAccessDlfConverter.pm,v 1.8 2008/06/12 15:04:32 wraay Exp $
πΈ AUTHORS πΈ
The legends behind it:
- Joost Bekkers
<joost@jodocus.org> - Joost van Baal
<joostvb@logreport.org> - Wessel Dankers
<wsl@logreport.org>
π COPYRIGHT π
Legal-ish but important: Copyright (C) 2001 Joost Bekkers <joost@jodocus.org> Copyright (C) 2001-2003 Stichting LogReport Foundation LogReport@LogReport.org
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
Okay that's the whole page, bestie β Lire 2.1.1, dated 2025-09-28, signing off with a little bow ππβ¨
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms