Configuring Squid proxy server and ProxyInspector to work together

Configuring Squid proxy server and ProxyInspector to work together

All articles

ProxyInspector supports virtually all formats of Squid access logs, including the 4 formats defined in squid.conf after installation:
 
logformat squid %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt
logformat squidmime %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt [%>h] [%<h]
logformat common %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st %Ss:%Sh
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh

To use any of the formats, you need to add the following line in the squid.conf file:

access_log <filepath> <logformat name>

In ProxyInspector, select the name of the necessary format, specify the path to log files and the mask:

However, formats do not contain fields by default:
%mt - MIME content type
%rp - Request URL-Path excluding hostname
%{Referer}>h - HTTP Referer  

These fields are not mandatory, but are used by ProxyInspector for report generation. ProxyInspector comes with predefined and modified formats of access logs containing the following fields:

logformat squidmod %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt %rp "%{Referer}>h"
logformat squidmimemod %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt %rp [%>h] [%<h] "%{Referer}>h"        
logformat commonmod %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st %Ss:%Sh %mt %rp "%{Referer}>h"

We recommend using these formats with %mt and %rp fields. To do this, you need to add a format line to the squid.conf file and specify it in the access_log directive. Once done, restart the Squid proxy server.

You can also use another format of log files. To do this, select a "Custom" format in ProxyInspector and manually set the positions of all fields in a line (starting from 0):


Tags: Squid, ProxyInspector, squid.conf, access.log, log file