3 .\" Author: Frédéric Marchal <fmarchal@users.sourceforge.net>
4 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
10 .TH "SARG" "1" "12 Nov 2015" "sarg" "SARG"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 sarg \- Squid Analysis Report Generator
34 \fBsarg\fR [options] [logfile...]
38 is a log file parser and analyzer for the
39 \m[blue]\fBSquid Web Proxy Cache\fR\m[]\&\s-2\u[1]\d\s+2\&. It allows you to view "where" your users are going to on the Internet\&.
42 generates reports in HTML with fields such as: users, IP Addresses, bytes, sites, and times\&. These HTML files can appear in your web server\*(Aqs directory for browsing by users or administrators\&. You may also have
44 email the reports to the Squid Cache administrator\&.
51 access logs\&. Optionally, it can complement the reports with the log of a Squid filter/redirector such as
52 \m[blue]\fBsquidGuard\fR\m[]\&\s-2\u[2]\d\s+2\&.
55 A summary of options is included below\&.
57 \fB\-h\fR \fB\-\-help\fR
59 Show summary of options\&.
62 \fB\-a hostname|ip address\fR
64 Limits report to records containing the specified hostname/ip address
67 \fB\-b \fR\fB\fIfilename\fR\fR
69 Enables UserAgent log and writes it to
73 \fB\-c \fR\fB\fIfilename\fR\fR
77 for a list of the web hosts to exclude from the report\&. See
78 the section called \(lqHOST EXCLUSION FILE\(rq\&.
85 log file date/time field to a human\-readable format\&. All the log files are read and output as one text on the standard output\&.
90 Output, on the standard output, the internal css
92 inlines in the reports\&. You can redirect the output to a file of your choice and edit it\&. Then you can override the internal css with
93 \fIexternal_css_file\fR
97 Using an external css can reduce the size of the report file\&. If you are short on disk space, you may consider exporting the css as explained above\&.
100 \fB\-d \fR\fB\fIdate\fR\fR
104 to restrict the report to some date range during log file processing\&. Format for
107 \fBdd/mm/yyyy\-dd/mm/yyyy\fR
109 \fBdd/mm/yyyy\fR\&. Date ranges can also be specified as
110 \fIday\-\fR\fI\fBn\fR\fR,
111 \fIweek\-\fR\fI\fBn\fR\fR, or
112 \fImonth\-\fR\fI\fBn\fR\fR
115 is the number of days, weeks or months to jump backward\&. Note that there is no spaces around the hyphen\&.
118 \fB\-e \fR\fB\fIemail\fR\fR
122 (stdout for console)\&.
125 \fB\-f \fR\fB\fIfilename\fR\fR
127 Reads configuration from
133 Sets date format in generated reports\&.
135 e = Europe \-> dd/mm/yy
144 Generates reports by user and ip address\&.
150 .nr an-no-space-flag 1
159 option in config file to contain "users_sites"\&.
166 Don\*(Aqt delete any old report\&. It is equivalent to setting
168 but is provided for convenience\&.
171 \fB\-l \fR\fB\fIfilename\fR\fR
175 as the input log\&. This option can be repeated up to 255 times to read multiple files\&. If the files end with the extension
180 they are decompressed\&. If the file name is just
181 \fI\-\fR, the log file is read from standard input\&. In that case, it cannot be compressed\&.
183 This option is kept for compatibility with older versions of sarg but, starting with
184 sarg 2\&.3, the log files may be named on the command line without the
186 option\&. It allows the use of wildcards on the command line\&. Make sure you don\*(Aqt exceed the limit of 255 files\&.
189 \fB\-\-lastlog \fR\fB\fIn\fR\fR
191 Limit the number of logs kept in the output directory to
192 \fIn\fR\&. Any supernumerary report is deleted starting with the oldest report\&. The value of
194 must be positive or zero\&. A value of zero means no report should be deleted\&.
197 \fB\-L \fR\fB\fIfilename\fR\fR
199 Reads a proxy redirector log file such as one created by
202 Rejik\&. If you use this option, you may want to configure
203 \fIredirector_log_format\fR
206 to match the output format of your web content filtering program\&. This option can be repeated up to 64 times to read multiple files\&.
211 Enables ip address resolution\&.
214 \fB\-o \fR\fB\fIdir\fR\fR
222 Generates reports using ip address instead of userid\&.
225 \fB\-P \fR\fB\fIprefix\fR\fR \fB\-\-splitprefix \fR\fB\fIprefix\fR\fR
227 This option must be used with
228 \fB\-\-split\fR\&. If it is provided, the input log is split among several files each containing one day\&. The name of the output files is made of the
230 and the date formated as
233 The output files are written in the output directory specified with
235 or in the current directory\&.
240 Output the realtime report on the standard output and exit\&.
243 \fB\-s \fR\fB\fIstring\fR\fR
245 Limits report to the site specified by
247 [eg\&. www\&.debian\&.org]
252 Split the squid log file and output it as text on the standard output omitting the dates outside of the range specified by the
254 parameter\&. If it is combined with
256 the dates are also converted to a human\-readable format\&.
259 \fB\-P\fR, the log is written in several files each containing one day of the original log\&.
264 Writes some statistics about the execution time\&. The statistics include the total execution time; the number of records read in the input log files and the time it took to read them; the number of records and users processed and the time it took to process them\&.
267 \fB\-t \fR\fB\fIstring\fR\fR
269 Limits the records included in the report based on time\-of\-day\&. Format for
274 \fBHH:MM\-HH:MM\fR\&. The former reports only the requested time\&. The latter reports any entry falling within the requested range\&. This limit complement the limit imposed by option
278 \fB\-u \fR\fB\fIuser\fR\fR
287 Write sarg version and exit\&.
290 \fB\-w \fR\fB\fIdir\fR\fR
292 Store temporary files in
293 \fIdir\fR\&. In fact,
295 stores its temporary files in the
298 \fIdir\fR\&. Be sure to set the HTML output directory to a place outside of the temporary directory or sarg may fail or delete the report when it completes its task\&.
303 Writes debug messages to
309 Writes process messages to
312 .SH "HOST EXCLUSION FILE"
314 Sarg can be told to exclude visited hosts from the report by providing it with a file containing one host to exclude per line\&. The "host" may be one of the following:
335 a host name starting with a wildcard (*) to match any prefix,
357 a subnet noted a\&.b\&.c\&.d/e\&.
360 \fBExample\ \&1.\ \&Example of a hosts exclusion file\fR
368 Sarg cannot exclude IPv6 addresses at the moment\&.
374 This manual page was written by
375 Luigi Gangitano<gangitano@lugroma3\&.org>, for the
377 system (but may be used by others)\&. Revised by
380 Currently maintained by
381 Frédéric Marchal<fmarchal@users\&.sourceforge\&.net>\&.
384 \fBFrédéric Marchal\fR <\&fmarchal@users\&.sourceforge\&.net\&>
386 Docbook version of the manual page
391 Revision of the manual page
394 \fBLuigi Gangitano\fR <\&gangitano@lugroma3\&.org\&>
396 Author of the first manual page
400 Copyright \(co 2012 Frédéric Marchal
404 Squid Web Proxy Cache
406 \%http://www.squid-cache.org/
411 \%http://www.squidguard.org/