注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

itoedr的it学苑

记录从IT文盲学到专家的历程

 
 
 

日志

 
 

squid日志格式参数  

2013-05-11 03:25:01|  分类: squid系统应用 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

在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
  评论这张
 
阅读(132)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017