[go: up one dir, main page]

Menu

[b48fe1]: / sarg_manpage.xml  Maximize  Restore  History

Download this file

423 lines (372 with data), 13.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd'>
<article lang="en">
<title>SARG</title>
<refentry id="sarg">
<refentryinfo>
<productname>sarg</productname>
<date>12 Nov 2015</date>
<author>
<firstname>Frédéric</firstname>
<surname>Marchal</surname>
<contrib>Docbook version of the manual page</contrib>
<email>fmarchal@users.sourceforge.net</email>
</author>
<author>
<firstname>Billy</firstname>
<surname>Newsom</surname>
<contrib>Revision of the manual page</contrib>
</author>
<author>
<firstname>Luigi</firstname>
<surname>Gangitano</surname>
<contrib>Author of the first manual page</contrib>
<email>gangitano@lugroma3.org</email>
</author>
<copyright>
<year>2012</year>
<holder>Frédéric Marchal</holder>
</copyright>
</refentryinfo>
<refmeta>
<refentrytitle>sarg</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>sarg</refname>
<refpurpose>Squid Analysis Report Generator</refpurpose>
<!--<refclass>UNIX/Linux</refclass>-->
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>sarg</command>
<arg choice="opt">options</arg>
<arg choice="opt" rep="repeat">logfile</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
<para>
<command>sarg</command> is a log file parser and analyzer for the <ulink url="http://www.squid-cache.org/">Squid Web Proxy Cache</ulink>.
It allows you to view "where" your users are going to on
the Internet.
</para>
<para>
<command>sarg</command> 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 <command>sarg</command> email the reports to the Squid Cache administrator.
</para>
<para>
<command>sarg</command> can read <application>squid</application> or <application>Microsoft ISA</application> access logs.
Optionally, it can complement the reports with the log of a Squid filter/redirector such as
<ulink url="http://www.squidguard.org/">squidGuard</ulink>.
</para>
</refsect1>
<refsect1><title>Options</title>
<para>
A summary of options is included below.
</para>
<variablelist>
<varlistentry><term><option>-h</option> <option>--help</option></term>
<listitem>
<para>
Show summary of options.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-a hostname|ip address</option></term>
<listitem>
<para>
Limits report to records containing the specified hostname/ip address
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-b <replaceable>filename</replaceable></option></term>
<listitem>
<para>
Enables UserAgent log and writes it to <replaceable>filename</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-c <replaceable>filename</replaceable></option></term>
<listitem>
<para>
Read <replaceable>filename</replaceable> for a list of the web hosts to exclude from the report. See <xref linkend="ExcludeHostFile"/>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>--convert</option></term>
<listitem>
<para>
Convert a <application>squid</application> 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.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>--css</option></term>
<listitem>
<para>
Output, on the standard output, the internal css <command>sarg</command> 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
<parameter>external_css_file</parameter> in <filename>sarg.conf</filename>.
</para>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-d <replaceable>date</replaceable></option></term>
<listitem>
<para>
Use <replaceable>date</replaceable> to restrict the report to some date range during log file processing.
Format for <replaceable>date</replaceable> is <userinput>dd/mm/yyyy-dd/mm/yyyy</userinput>
or a single date <userinput>dd/mm/yyyy</userinput>. Date ranges can also be specified as
<parameter>day-<constant>n</constant></parameter>, <parameter>week-<constant>n</constant></parameter>,
or <parameter>month-<constant>n</constant></parameter> where <constant>n</constant>
is the number of days, weeks or months to jump backward. Note that there is no spaces around the hyphen.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-e <replaceable>email</replaceable></option></term>
<listitem>
<para>
Sends report to <replaceable>email</replaceable> (stdout for console).
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-f <replaceable>filename</replaceable></option></term>
<listitem>
<para>
Reads configuration from <replaceable>filename</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-g e|u</option></term>
<listitem>
<para>
Sets date format in generated reports.
<simplelist>
<member>e = Europe -> dd/mm/yy</member>
<member>u = USA -> mm/dd/yy</member>
</simplelist>
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-i</option></term>
<listitem>
<para>
Generates reports by user and ip address.
</para>
<note>
<simpara>
This requires the <replaceable>report_type</replaceable>
option in config file to contain "users_sites".
</simpara>
</note>
</listitem>
</varlistentry>
<varlistentry><term><option>--keeplogs</option></term>
<listitem>
<para>
Don't delete any old report. It is equivalent to setting <option>--lastlog 0</option> but is
provided for convenience.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-l <replaceable>filename</replaceable></option></term>
<listitem>
<para>
Uses <replaceable>filename</replaceable> as the input log. This option can be repeated up to 255 times to read
multiple files. If the files end with the extension <filename>.gz</filename>, <filename>.bz2</filename> or
<filename>.Z</filename> they are decompressed. If the file name is just
<replaceable>-</replaceable>, the log file is read from standard input. In that case, it cannot be compressed.
</para>
<para>
This option is kept for compatibility with older versions of sarg but, starting with <application>sarg 2.3</application>,
the log files may be named on the command line without the <option>-l</option>
option. It allows the use of wildcards on the command line. Make sure you don't exceed the limit of 255 files.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>--lastlog <replaceable>n</replaceable></option></term>
<listitem>
<para>
Limit the number of logs kept in the output directory to <replaceable>n</replaceable>. Any supernumerary report
is deleted starting with the oldest report. The value of <replaceable>n</replaceable> must be positive or zero.
A value of zero means no report should be deleted.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-L <replaceable>filename</replaceable></option></term>
<listitem>
<para>
Reads a proxy redirector log file such as one created by <application>squidGuard</application> or <application>Rejik</application>.
If you use this option, you may want to configure <replaceable>redirector_log_format</replaceable>
in <filename>sarg.conf</filename> to match the output format of your web content filtering program.
This option can be repeated up to 64 times to read multiple files.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-n</option></term>
<listitem>
<para>
Enables ip address resolution.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-o <replaceable>dir</replaceable></option></term>
<listitem>
<para>
Writes report in <replaceable>dir</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-p</option></term>
<listitem>
<para>
Generates reports using ip address instead of userid.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-P <replaceable>prefix</replaceable></option> <option>--splitprefix <replaceable>prefix</replaceable></option></term>
<listitem>
<para>
This option must be used with <option>--split</option>. 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 <replaceable>prefix</replaceable>
and the date formated as <literal>-YYYY-MM-DD</literal>.
</para>
<para>
The output files are written in the output directory
specified with <option>-o</option> or in the current directory.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-r</option></term>
<listitem>
<para>
Output the realtime report on the standard output and exit.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-s <replaceable>string</replaceable></option></term>
<listitem>
<para>
Limits report to the site specified by <replaceable>string</replaceable>
[eg. www.debian.org]
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>--split</option></term>
<listitem>
<para>
Split the squid log file and output it as text on the standard output omitting the dates outside of the
range specified by the <option>-d</option> parameter.
If it is combined with <option>--convert</option>
the dates are also converted to a human-readable format.
</para>
<para>
Combined with <option>-P</option>, the log is written in several files each containing one day of the
original log.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>--statistics</option></term>
<listitem>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-t <replaceable>string</replaceable></option></term>
<listitem>
<para>
Limits the records included in the report based on time-of-day. Format for
<replaceable>string</replaceable> is <userinput>HH:MM</userinput> or <userinput>HH:MM-HH:MM</userinput>.
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 <option>-d</option>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-u <replaceable>user</replaceable></option></term>
<listitem>
<para>
Limits reports to <replaceable>user</replaceable> activities.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-v</option></term>
<listitem>
<para>
Write sarg version and exit.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-w <replaceable>dir</replaceable></option></term>
<listitem>
<para>
Store temporary files in <replaceable>dir</replaceable>. In fact, <command>sarg</command> stores its temporary files in
the <filename class="directory">sarg</filename> subdirectory of <replaceable>dir</replaceable>. 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.
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-x</option></term>
<listitem>
<para>
Writes debug messages to <filename class="devicefile">stdout</filename>
</para>
</listitem>
</varlistentry>
<varlistentry><term><option>-z</option></term>
<listitem>
<para>
Writes process messages to <filename class="devicefile">stdout</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="ExcludeHostFile"><title>Host exclusion file</title>
<para>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:
</para>
<itemizedlist>
<listitem><para>a full host name,</para></listitem>
<listitem><para>a host name starting with a wildcard (*) to match any prefix,</para></listitem>
<listitem><para>a single ip address,</para></listitem>
<listitem><para>a subnet noted a.b.c.d/e.</para></listitem>
</itemizedlist>
<example><title>Example of a hosts exclusion file</title>
<simplelist>
<member>*.google.com</member>
<member>10.0.0.0/8</member>
</simplelist>
</example>
<para>
Sarg cannot exclude IPv6 addresses at the moment.
</para>
</refsect1>
<refsect1><title>See also</title>
<para>
squid(8)
</para>
</refsect1>
<refsect1><title>Authors</title>
<para>
This manual page was written by <personname><firstname>Luigi</firstname> <surname>Gangitano</surname></personname>
<email>gangitano@lugroma3.org</email>,
for the <systemitem class="osname">Debian GNU/Linux</systemitem> system (but may be used by others). Revised
by <personname><firstname>Billy</firstname> <surname>Newsom</surname></personname>.
</para>
<para>
Currently maintained by <personname><firstname>Frédéric</firstname> <surname>Marchal</surname></personname>
<email>fmarchal@users.sourceforge.net</email>.
</para>
</refsect1>
</refentry>
</article>