Search Suggest

custome squid log

ปรับแต่ง access.log ใน squid เพื่อให้แสดงวันที่ด้วย ดังนี้

Setting Maximum Download Size

Ref. linuxquestions.org




ตัวอย่าง

Old




New



Such as when an allstaff email goes out saying "check this site out..."
  • TCP_MISS/200 means that the requested document was not in the cache but it could fetch it OK from the web server. The direct at the end says that the file was fetched from the webserver.
  • TCP_IMS_HIT/304 means that the client asked if the file has changed, and squid checked its date/time on the webserver and found it had not changed, so it gave a copy of the file to the client out of its local cache.
Ref: imrgill.com
การปรับแต่ง log ให้เอาชื่อ user Authen ขึ้นมาก่อน
อันเก่าเรียง ตาม date, repornse time, ip, website, user login, ....



อันใหม่เรียง date, response time, user login, ....
ให้แก้ไขโดยนำ %un ขึ้นมาก่อน %>a
*สามารถใส่คำ เช่น user=[%un] ได้ดังรูปด้านล่าง



ตรวจสอบ log ดูภาพด้านล่าง
log formate code



Log format codes  

Field name syntax keys:
     {} modifier or argument. Also used to specify header names
> request (client)
< reply (server)
a address
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)

Add caption






Squid Format
Ref. trafficserver.apache.org



 






1
    cqtq The client request timestamp in Squid format; the time of the client request in seconds since January 1, 1970 UTC (with millisecond resolution).
2
    ttms The time Traffic Server spent processing the client request; the number of milliseconds between the time the client established the connection with Traffic Server and the time Traffic Server sent the last byte of the response back to the client.
3
    chi The IP address of the client’s host machine.
4

    crc/pssc The cache result code; how the cache responded to the request: HIT, MISS, and so on. Cache result codes are described here.

        The proxy response status code (the HTTP response status code from

    Traffic Server to client).
5
    psql The length of the Traffic Server response to the client in bytes, including headers and content.
6
    cqhm The client request method: GET, POST, and so on.
7
    cquc The client request canonical URL; blanks and other characters that might not be parsed by log analysis tools are replaced by escape sequences. The escape sequence is a percentage sign followed by the ASCII code number of the replaced character in hex.
8
    caun The username of the authenticated client. A hyphen (-) means that no authentication was required.
9
    phr/pqsn The proxy hierarchy route; the route Traffic Server used to retrieve the object.

    The proxy request server name; the name of the server that fulfilled the request. If the request was a cache hit, then this field contains a hyphen (-).
10
    psct The proxy response content type; the object content type taken from the Traffic Server response header.

Đăng nhận xét