squid 日志详解

简介:
 
在squid设置有日志格式设置
 logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
 参数解释如下
 Field name syntax keys:
      {} modifier or argument. Also used to specify header names
      >  request (client)  客户请求
      <  reply (server)    服务端回应
      a  address           访问用户ip地址
      A  address name  访问用户电脑名称
      h  all headers       浏览器头信息
      i  ident                
      p  port                 端口
      r  request line (no query)
      t  time   访问时间
      u  user
      l  local address/port (where request was accepted)
  • %>a

  • Client source IP address

  • %>A

  • Client FQDN

  • %>p

  • Client source port

  • %<a

  • Server or peer IP address

  • %<p

  • Server or peer port number

  • %<A

  • Server IP address or peer name

  • %la

  • Local IP address where the request was accepted

  • %lp

  • Local port where the request was accepted

  • %lA

  • Local port name where the request was accepted

  • %ts

  • Date of request, seconds since epoch

  • %{format}tl

  • Date of request, strftime format (localtime)

  • %{format}tg

  • Date of request, strftime format (gmt)

  • %tu

  • Date of request, sub-second component

  • %tr

  • Time to serve the request, in milliseconds

  • %{header}>h

  • Request header

  • %{header:element}>h

  • Named request header field element (list headers)

  • %{header:separator element}>h

  • Named request header field element, using "separator" as field separator (it can be any non-alphanumeric single character)

  • %>h

  • All request header

  • %{header}<h

  • Request headers, as for <..h above

  • %un

  • Authenticated user name or dash

  • %ur

  • Authenticated user realm or dash

  • %us

  • Authenticated user scheme or dash

  • %ui

  • Ident user name

  • %Hs

  • HTTP status code (200, 404, 407, etc)

  • %Ht

  • HTTP status text (Not found, etc)

  • %Ss

  • Squid status code (TCP_HIT, TCP_MISS etc)

  • %Se

  • Squid error code (ERR_DENIED, ERR_...)

  • %Sh

  • Squid hierarchy code (FIRST_UP_PARENT, etc)

  • %mt

  • MIME type of the request

  • %rm

  • Request method

  • %ru

  • Request URL, without the query string

  • %rq

  • Request query string, including ?

  • %rp

  • Request protocol (i.e. HTTP/1.1)

  • %ps

  • Peer selection status (DIRECT, PARENT, CD_PARENT_HIT, etc. including the TIMEDOUT_ variant)

  • %>sl

  • Size of request line

  • %>sh

  • Size of request headers, including request line

  • %>sH

  • Size of request headers, excluding request line

  • %>sb

  • Size of request body, raw received bytes

  • %>sB

  • Size of request body, excluding transfer encoding

  • %>st

  • Total size of request

  • %<sl

  • Size of reply status line

  • %<sh

  • Size of reply headers, including status line

  • %<sH

  • Size of reply headers, excluding status line

  • %<sb

  • Size of reply body, raw transmitted bytes

  • %<sB

  • Size of reply body, excluding transfer encoding

  • %<st

  • Total size of reply

  • %%

  • A literal %


  • 不记图片类访问日志设置
    acl nolog urlpath_regex \\.gif \\.jpg \\.css \\.js \\.swf
    access_log /data/squid/var/logs/access.log common !nolog


本文转自神ge 51CTO博客,原文链接:http://blog.51cto.com/12218412/1868943
相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
相关文章
|
监控 数据安全/隐私保护
Squid服务器ACL与日志分析
Squid服务器ACL与日志分析
225 0
Squid服务器ACL与日志分析
|
缓存 监控 数据安全/隐私保护
|
缓存 监控 Apache
Squid服务日志分析
转载自:  http://my.oschina.net/chenguang/blog/371275  Apache 和 Squid 是两种著名的代理缓存软件,但Squid 较 Apache 而言是专门的代理缓存服务器软件,其代理缓存的功能强大,支持 HTTP/1.1 协议,其缓存对象也较多;并且 Squid 的缓存管理模块和访问控制模块功能很强大。
1320 0
|
存储 监控 Unix
Squid 日志详解
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私募机构九鼎控股打造,九鼎投资是在全国股份转让系统挂牌的公众公司,股票代码为430719,为“中国PE第一股”,市值超1000亿元。
1862 0
|
15天前
|
关系型数据库 MySQL 数据库
mysql数据库bin-log日志管理
mysql数据库bin-log日志管理
|
15天前
|
存储 关系型数据库 数据库
关系型数据库文件方式存储LOG FILE(日志文件)
【5月更文挑战第11天】关系型数据库文件方式存储LOG FILE(日志文件)
76 1
|
16天前
|
运维 监控 安全
Java一分钟之-Log4j与日志记录的重要性
【5月更文挑战第16天】Log4j是Java常用的日志框架,用于灵活地记录程序状态和调试问题。通过设置日志级别和过滤器,可避免日志输出混乱。为防止日志文件过大,可配置滚动策略。关注日志安全性,如Log4j 2.x的CVE-2021-44228漏洞,及时更新至安全版本。合理使用日志能提升故障排查和系统监控效率。
73 0