3 .\" Author: Frédéric Marchal <fmarchal@users.sourceforge.net>
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
10 .TH "SARG" "1" "25 Jan 2011" "sarg" "SARG"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
16 .\" disable justification (adjust text to left margin only)
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
22 sarg \- Squid Analysis Report Generator
25 \fBsarg\fR [options] [logfile...]
30 is a log file parser and analyzer for the
31 \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\&.
35 generates reports in HTML with fields such as: users, IP Addresses, bytes, sites, and times\&. These HTML files can appear in your web server\'s directory for browsing by users or administrators\&. You may also have
37 email the reports to the Squid Cache administrator\&.
45 access logs\&. Optionally, it can complement the reports with the log of a Squid filter/redirector such as
46 \m[blue]\fBsquidGuard\fR\m[]\&\s-2\u[2]\d\s+2\&.
49 A summary of options is included below\&.
53 Show summary of options\&.
56 \fB\-a hostname|ip address\fR
58 Limits report to records containing the specified hostname/ip address
61 \fB\-b \fR\fB\fIfilename\fR\fR
63 Enables UserAgent log and writes it to
70 .nr an-no-space-flag 1
77 This option is currently unused\&.
82 \fB\-c \fR\fB\fIfilename\fR\fR
86 for a list of the web hosts to exclude from the report\&. See
87 the section called \(lqHOST EXCLUSION FILE\(rq\&.
94 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\&.
99 Output, on the standard output, the internal css
101 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
102 \fIexternal_css_file\fR
106 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\&.
109 \fB\-d \fR\fB\fIdate\fR\fR
113 to restrict the report to some date range during log file processing\&. Format for
116 \fBdd/mm/yyyy\-dd/mm/yyyy\fR
118 \fBdd/mm/yyyy\fR\&. Date ranges can also be specified as
119 \fIday\-\fR\fI\fBn\fR\fR,
120 \fIweek\-\fR\fI\fBn\fR\fR, or
121 \fImonth\-\fR\fI\fBn\fR\fR
124 is the number of days, weeks or months to jump backward\&. Note that there is no spaces around the hyphen\&.
127 \fB\-e \fR\fB\fIemail\fR\fR
131 (stdout for console)\&.
134 \fB\-f \fR\fB\fIfilename\fR\fR
136 Reads configuration from
142 Sets date format in generated reports\&.
144 e = Europe \-> dd/mm/yy
153 Generates reports by user and ip address\&.
159 .nr an-no-space-flag 1
168 option in config file to contain "users_sites"\&.
175 Don\'t delete any old report\&. It is equivalent to setting
177 but is provided for convenience\&.
180 \fB\-l \fR\fB\fIfilename\fR\fR
184 as the input log\&. This option can be repeated up to 255 times to read multiple files\&. If the files end with the extension
189 they are decompressed\&. If the file name is just
190 \fI\-\fR, the log file is read from standard input\&. In that case, it cannot be compressed\&.
192 This option is kept for compatibility with older versions of sarg but, starting with
193 sarg 2\&.3, the log files may be named on the command line without the
195 option\&. It allows the use of wildcards on the command line\&. Make sure you don\'t exceed the limit of 255 files\&.
198 \fB\-\-lastlog \fR\fB\fIn\fR\fR
200 Limit the number of logs kept in the output directory to
201 \fIn\fR\&. Any supernumerary report is deleted starting with the oldest report\&. The value of
203 must be positive or zero\&. A value of zero means no report should be deleted\&.
206 \fB\-L \fR\fB\fIfilename\fR\fR
208 Reads a proxy redirector log file such as one created by
211 Rejik\&. If you use this option, you may want to configure
212 \fIredirector_log_format\fR
215 to match the output format of your web content filtering program\&. This option can be repeated up to 64 times to read multiple files\&.
220 Enables ip address resolution\&.
223 \fB\-o \fR\fB\fIdir\fR\fR
231 Generates reports using ip address instead of userid\&.
234 \fB\-P \fR\fB\fIprefix\fR\fR \fB\-\-splitprefix \fR\fB\fIprefix\fR\fR
236 This option must be used with
237 \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
239 and the date formated as
242 The output files are written in the output directory specified with
244 or in the current directory\&.
247 \fB\-s \fR\fB\fIstring\fR\fR
249 Limits report to the site specified by
251 [eg\&. www\&.debian\&.org]
256 Split the squid log file and output it as text on the standard output omitting the dates outside of the range specified by the
258 parameter\&. If it is combined with
260 the dates are also converted to a human\-readable format\&.
263 \fB\-P\fR, the log is written in several files each containing one day of the original log\&.
266 \fB\-t \fR\fB\fIstring\fR\fR
268 Limits the records included in the report based on time\-of\-day\&. Format for
273 \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
277 \fB\-u \fR\fB\fIuser\fR\fR
284 \fB\-w \fR\fB\fIdir\fR\fR
286 Store temporary files in
287 \fIdir\fR\&. In fact,
289 stores its temporary files in the
292 \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\&.
297 Writes debug messages to
303 Writes process messages to
306 .SH "HOST EXCLUSION FILE"
308 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:
329 a host name starting with a wildcard (*) to match any prefix,
351 a subnet noted a\&.b\&.c\&.d/e\&.
354 \fBExample\ \&1.\ \&Example of a hosts exclusion file\fR
362 Sarg cannot exclude IPv6 addresses at the moment\&.
368 This manual page was written by
370 gangitano@lugroma3\&.org, for the
372 system (but may be used by others)\&. Revised by
375 Currently maintained by
377 fmarchal@users\&.sourceforge\&.net\&.
380 \fBFrédéric Marchal\fR <\&fmarchal@users\&.sourceforge\&.net\&>
382 Docbook version of the manual page
387 Revision of the manual page
390 \fBLuigi Gangitano\fR <\&gangitano@lugroma3\&.org\&>
392 Author of the first manual page
396 Copyright \(co 2011 Frédéric Marchal
400 Squid Web Proxy Cache
402 \%http://www.squid-cache.org/
407 \%http://www.squidguard.org/