字段解释
1 %<chi> 客户端IP
2 %<caun> The username of the authenticated client. A hyphen (-) means that no authentication was required.
3 %<ttms> 响应时间,单位是毫秒/ms
4 %<cqts> 时间戳(The time of the client request since January 1, 1970 UTC (EPOCH), with second resolution.)
5 %<cqhm> The client request method: GET, POST, and so on.
6 %<cquuc> 原始的URL,即 This field records a URL before it is remapped (reverse proxy mode).
7 %<cqhv> HTTP版本,The client request HTTP version.
8 %<pssc> HTTP状态码
9 %<psql> 边缘server 返回的response长度,包括响应体和响应头,单位是 字节/byte
10 %<hii> 边缘server IP
11 %<pqsi> 回源server的IP,边缘server未命中,同机房server回源/上层server回源
12 %<crc> 边缘server响应的状态码
13 %<phr> 回源server响应的状态码
14 %<{Via}psh> 边缘server响应HTTP头部信息,截取Via信息
15 %<{Referer}cqh> 客户端请求的HTTP头部信息,截取Referer信息
16 %<{User-Agent}cqh> 客户端请求的HTTP头部信息,截取User-Agent信息
Cache Result Codes
1 1)"TCP_MEM_HIT:NONE" 边缘server内存命中(官网没有找到相关说明,自己臆断而来)
2 2)"TCP_HIT:NONE" 边缘server缓存命中
3 3)"TCP_MISS:SIBLING_HIT" 边缘server Miss,icp同机房回源命中
4 4)"TCP_MISS:PARENT_HIT" 边缘server Miss,icp Miss,parent回源命中
5 5)"TCP_REFRESH_HIT:PARENT_HIT" 边缘server含有客户端请求的object,但是不新鲜,所以边缘server向parent发起一个“if-modified-since”请求,parent返回304not-modified的响应,最后边缘server将本地的object返回。
6 6)"TCP_REFRESH_MISS:PARENT_HIT" 边缘server含有客户端请求的object,但是不新鲜,所以边缘server向parent发起一个“if-modified-since”请求,parent返回一个新的object给边缘server,最后边缘server将新获取到的object返回。
7 7)"ERR_CLIENT_ABORT:SIBLING_HIT" 客户端还没有完成数据的获取就断掉了链接(icp回源)
8 8)"ERR_CLIENT_ABORT:PARENT_HIT" 客户端还没有完成数据的获取就断掉了链接(parent回源)
9 ...
10 9)"TCP_IMS_HIT:NONE" The client issued an if-modified-since request and the object was in cache and fresher than the IMS date, or an if-modified-since request to the origin server revealed the cached object was fresh. Traffic Server served the cached object to the client.
11 10)"TCP_IMS_MISS:PARENT_HIT"
12 11)"TCP_REF_FAIL_HIT:" The object was in the cache but was stale. Traffic Server made an if-modified-since request to the origin server but the server did not respond. Traffic Server sent the cached object to the client.
13 ...
14 "ERR_CONNECT_FAIL:DIRECT"
15 "ERR_CONNECT_FAIL" -> Traffic Server could not reach the origin server.
16
17 # 更多详细信息参考:https://docs.trafficserver.apache.org/en/6.2.x/admin-guide/monitoring/logging/log-formats.en.html#cache-result-codes
logs_xml.config
1 <LogFormat>
2 <Name = "access"/>
3 <Format = ""live" "0.1" "%<chi>" "%<caun>" "%<ttms>" "%<cqts>" "%<cqhm>" "%<cquuc>" "%<cqhv>" "%<pssc>" "%<psql>" "%<hii>" "%<pqsi>" "%<crc>:%<phr>" "%<{Via}psh>" "%<{Referer}cqh>" "%<{User-Agent}cqh>""/>
4 </LogFormat>
5 <LogObject>
6 <Format = "access"/>
7 <Filename = "access.log"/>
8 </LogObject>