squid日志格式处理
先看看squid原始文档怎么解释吧#TAG: logformat
# Usage:
#
# logformat
#
# Defines an access log format.
#
# Theis 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.
#
# % ["|[|'|#] [-] [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 literal % character
# >a Client source IP address
# >A Client FQDN
# >p Client source port
# h
# 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 sent to the client
# sh Received HTTP request headers size
# request (client)客户请求
<reply (server) 服务端回应
aaddress 访问用户ip地址
Aaddress name 访问用户电脑名称
hall headers 浏览器头信息
iident
pport 端口
rrequest line (no query)
ttime 访问时间
uuser
llocal address/port (where request was accepted)
自己squid配置文件日志格式定义如下:
logformat cccdn%>a %ui %un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh
页:
[1]