Squid request status

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. Also refer to the explainations for negative_ttl in your squid.conf file.
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, see
offline_mode in 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 either UDP_HIT or this code.
Neighbours will thus only fetch hits.
NONE
Seen with errors and cachemgr requests.
The following codes are no longer available in Squid-2:
ERR_*
Errors are now contained in the status code.
TCP_CLIENT_REFRESH
See: TCP_CLIENT_REFRESH_MISS.
TCP_SWAPFAIL
See: TCP_SWAPFAIL_MISS.
TCP_IMS_MISS
Deleted, TCP_IMS_HIT used instead.
UDP_HIT_OBJ
Hit objects are no longer available.
UDP_RELOADING
See: UDP_MISS_NOFETCH.

Share

Squid Hierarchy Codes

NONE For TCP HIT, TCP failures, cachemgr requests and all UDP requests, there is no hierarchy information.

DIRECT The object was fetched from the origin server.

SIBLING_HIT The object was fetched from a sibling cache which replied with UDP_HIT.

PARENT_HIT The object was requested from a parent cache which replied with UDP_HIT.

DEFAULT_PARENT No ICP queries were sent. This parent was chosen because it was marked “default” in the config file.

SINGLE_PARENT The object was requested from the only parent appropriate for the given URL.

FIRST_UP_PARENT The object was fetched from the first parent in the list of parents.

NO_PARENT_DIRECT The object was fetched from the origin server, because no parents existed for the given URL.

FIRST_PARENT_MISS The object was fetched from the parent with the fastest (possibly weighted) round trip time.

CLOSEST_PARENT_MISS This parent was chosen, because it included the the lowest RTT measurement to the origin server. See also the closest-only peer configuration option.

CLOSEST_PARENT The parent selection was based on our own RTT measurements.

CLOSEST_DIRECT Our own RTT measurements returned a shorter time than any parent.

NO_DIRECT_FAIL The object could not be requested because of a firewall configuration, see also never_direct and related material, and no parents were available.

SOURCE_FASTEST The origin site was chosen, because the source ping arrived fastest.

ROUNDROBIN_PARENT No ICP replies were received from any parent. The parent was chosen, because it was marked for round robin in the config file and had the lowest usage count.

CACHE_DIGEST_HIT The peer was chosen, because the cache digest predicted a hit. This option was later replaced in order to distinguish between parents and siblings.

CD_PARENT_HIT The parent was chosen, because the cache digest predicted a hit.

CD_SIBLING_HIT The sibling was chosen, because the cache digest predicted a hit.

NO_CACHE_DIGEST_DIRECT This output seems to be unused?

CARP The peer was selected by CARP.

PINNED The server connection was pinned by NTLM or Negotiate authentication requirements.

ORIGINAL_DST The server connection was limited to the client provided destination IP. This only occurs on interception proxies when Host security is enabled.

ANY_PARENT part of src/peer_select.c:hier_strings[].

INVALID CODE part of src/peer_select.c:hier_strings[].

Share

squid logformat (适用版本2.7)

摘抄下官方手册,部分翻译

Usage:

	logformat <name> <format specification>

	Defines an access log format.

	The <format specification> is a string with embedded % format codes

	% format codes all follow the same basic structure where all but
	the formatcode is optional. Output strings are automatically escaped
	as required according to their context and the output format
	modifiers are usually not needed, but can be specified if an explicit
	output format is desired.

		% ["|[|'|#] [-] [[0]width] [{argument}] formatcode

		"	output in quoted string format
		[	output in squid text log format as used by log_mime_hdrs
		#	output in URL quoted format
		'	output as-is

		-	left aligned
		width	field width. If starting with 0 the
			output is zero padded
		{arg}	argument such as header name etc

	Format codes:

		>a	Client source IP address / 客户端 IP
		>A	Client FQDN / 客户端完整域名,是指主机名+全路径
		>p	Client source port / 客户端端口
		<A	Server IP address or peer name / 服务器ip 或者 对端名
		la	Local IP address (http_port) / 本地ip地址
		lp	Local port number (http_port) / 本地端口号
		oa	Our outgoing IP address (tcp_outgoing_address) / 传出的ip地址
		ts	Seconds since epoch / unix时间戳
		tu	subsecond time (milliseconds) / 毫秒
		tl	Local time. Optional strftime format argument / 本地时间
			default %d/%b/%Y:%H:%M:%S %z
		tg	GMT time. Optional strftime format argument / 格林尼治标准时间
			default %d/%b/%Y:%H:%M:%S %z
		tr	Response time (milliseconds) / 响应时间(毫秒)
		>h	Request header. Optional header name argument 
			on the format header[:[separator]element] /请求头
		<h	Reply header. Optional header name argument 
			as for >h / 响应头
		un	User name /用户名
		ul	User name from authentication /认证的用户名
		ui	User name from ident 
		us	User name from SSL
		ue	User name from external acl helper
		Hs	HTTP status code / http 状态码
		Ss	Squid request status (TCP_MISS etc) / squid 请求状态
		Sh	Squid hierarchy status (DEFAULT_PARENT etc) / squid 层次结构状态
		mt	MIME content type / MIME内容类型
		rm	Request method (GET/POST etc) /请求方法
		ru	Request URL /请求的url
		rp	Request URL-Path excluding hostname /不包含主机名的请求url
		rv	Request protocol version / 请求协议版本
		ea	Log string returned by external acl
		<st	Reply size including HTTP headers /响应大小,包括HTTP头
		>st	Request size including HTTP headers /请求大小,包括HTTP头
		st	Request+Reply size including HTTP headers /请求大小+响应大小,包括HTTP头
		sn	Unique sequence number per log line entry /唯一序列号
		%	a literal % character 
Share