CALAMARIS(1)
okay bestie, welcome to calamaris(1) β the Calamaris Manual, section 1, and this is part 1 of 2 so don't go anywhere π This is the page that explains all the options and shows you a few examples. Buckle up, it's a long one, but it's so worth it fr fr.
β¨ NAME β¨
calamaris β generate text and graphical statistics out of log files from Proxy-Cache-Servers π
π¦ SYNOPSIS π¦
cat log | calamaris [ --config-file .../calamaris.conf ] [ switches ]
π DESCRIPTION π
So here's the vibe: Calamaris is the girl who takes your proxy log files and turns them into statistics. She eats log files from Squid, NetCache, Inktomi Traffic Server, Oops! proxy server, Compaq Tasksmart, Cisco Content Engines or any related Proxy log files. no cap.
And the output? Iconic. It can be ascii or html, with or without graphics, with or without frames β you get to choose your aesthetic π
Also, and this is the lowkey genius part: it's possible to cache calculated data in a file so you can use them in later runs. Reusing your own work? That's main character energy honestly.
This manual page describes the options of Calamaris and gives a few examples. periodt.
π OPTIONS π
π Configuration File
--config-file fileβ Not all reports and modification can be made through command-line-switches, bestie. To use all options of Calamaris you'll have to use the configuration file. You'll find the configuration-directives below, always inside of braces. Examples are in thecalamaris.confwhich should come with this package. π«Ά
π Reports
--all-useful-reports|-aβ extracts all useful reports available.--all-useful-reportsequals--size-distribution-report 10 --domain-report 20 --performance-report 60 --requester-report 20 --status-report --type-report 20 --response-time-report --errorcode-distribution-report--domain-report|-d n($domain_report)β switches the top level and the second level report on. The data is derived from the URL. The output is limited by n. (-1is unlimited)--domain-report-limit n($domain_report_limit)β limit the domain-report to lines which have n or more requests.--domain-report-n-level|-N n($domain_report_n_level)β All URL-Host reports will be switched from 2nd-level to n-level-reports. (-1shows a full urlhost-report)
Note: This option is only useful with activated domain-report.
--errorcode-distribution-report($errorcode_distribution_report)β shows the Response code distribution over all objects($object_freshness_report)β shows the freshness of objects in your cache. Calamaris looks for freshness tags like'TCP_HIT','TCP_REFRESH_MISS', ... and makes statistics on it. With this information you can optimize the caching behaviour of your cache depending on the objects content type. E.g. squid admins could use this information to configure therefresh_pattern. This option needs more configuration in the configuration-file.--peak-report|-p type($peak_report)β Measures the peaks of the Proxy usage in requests per second, per minute and per hour. It reports peaks for TCP, UDP and ALL requests. If set to'old'these values were calculated with the old slow method, if set to'new'the new faster (but still slow) method is used. π--performance-report|-P n($performance_report)β Shows the throughput of TCP requests for every n minutes.--performance-report-adjust|-T n($performance_report_adjust)β Time: Adjust the Performancereport in minutes for non GMT-Timezoners.--requester-report|-r n($requester_report)β Switches the UDP and TCP requester reports on. The output is limited by n. (-1is unlimited)--requester-report-no-dns-lookup|-n($requester_report_no_dns_lookup)β Switches the IP lookup for the requesters off.--requester-report-use-user-info|-u($requester_report_use_user_info)β Switches the usage of eventually available ident information for requester reports on.
Warning: This breaks the privacy of your users! (see PRIVACY-Section below)
--requester-report-with-targets|-R n($requester_report_with_targets)β adds to each line of the requester report the requested URLs. The output is limited by n. (-1is unlimited, and can result in very very long reports.)
Warning: Using this option breaks the privacy of your users! (see PRIVACY-Section below)
--response-time-report($response_time_report)β sums up the time distribution over all objects(@response_time_report_interval)β This array defines the time steps, which should be reported in the response-time-report.--size-distribution-report|-D n($size_distribution_report)β shows size-based distribution of requested objects, smaller numbers result in more verbose reports. (choose2,10or100for useful output.)--status-report|-s($status_report)β alters the default behaviour of Calamaris and makes the status reports more verbose.--type-report|-t n($type_report)β switches the content type and the file extension report on. The output is limited by n. (-1is unlimited)--type-report-ignore-case|-c($type_report_ignore_case)β Switch to case-insensitive. This is useful for the'Requested extensions'report.
π₯ Input
--input-format|-f type($input_format)β sets the type of input logfiles. If set to:'auto'β Calamaris tries to guess the input file format. This is the Default.
Note: If the first line of your input file is corrupted, Calamaris will stop with an error.
'squid'β Calamaris expects native logfile derived from SquidV1.1.beta26-V2.xor OOPS.'squid-extended'β Calamaris expects native logfile derived from SquidV1.1.alpha1-V2.xwithlog_mime_hdrsenabled or Squid with Smartfilter-Patch or squid-style logfiles out of Cisco Content Engines. (This only enables parsing of these kind of logfile, the additional data will be ignored.)
(Logging of MIME-Headers breaks the privacy of your users! (see PRIVACY-Section below)
'squid-old'β Calamaris expects native logfile derived from SquidV1.1.alpha1-V1.1.beta25.'nc'β Calamaris expects Logfiles from NetCache up toV4.x. (Please see the README on this.)'its'β Calamaris expects Logfiles from Inktomi Traffic Server.'elff'β Calamaris expects Logfiles in Extended Logfile Format (i.e. from Compaq Tasksmart, Novell Internet Caching System or NetCacheV5.x)'nse'β Calamaris expects Logfiles in Netscape Extended-1 or Netscape Extended-2 Logfile Format (from Netscape/iPlanet/SunOne Proxy-Server )
--ipfilter-exclude IP/range($ipfilter_exclude)β all IPs are analyzed, except IP/range. Format:
1.1.1.1/32:1.1.2.0/24 or
1.1.1.1/255.255.255.255:1.1.2.0/255.255.255.0
IP list separated by ':' This switch needs the perl Module NetAddr::IP.
Warning: This breaks the privacy of your users! (see PRIVACY-Section below)
--ipfilter-include IP/range($ipfilter_include)β no IPs are analyzed, except IP/range. Format: see--ipfilter-exclude
Warning: This breaks the privacy of your users! (see PRIVACY-Section below)
--no-input|-z($no_input)β Switches reading from standard input off. You can use this to merge many cache files to one (see--cache-input-fileand--cache-output-file) or to generate a report out of cache files.--time-interval|-I t-t($time_interval)β defines which time-interval should be parsed. t has to be the formatyyyymmddhhmmss(localtime)
Note: omitting the beginning or ending date is allowed.
π€ Output
Standard output format is plain ascii with 80 chars width. cute and classic π
($column1_color)($column2_color)β defines the colors for the columns in graphics. (only useful with--output-format graph)($formats[n])β Through the config-file you are able to modify the width of the report and alter the culomns that are displayed in the reports. n is the number of the report, as displayed by--helpin the--show-reports-option.--hostname|-H name($hostname)β The name for the title or subject of the output. If set to'lookup'Calamaris looks up the host name of the system its been run on.--image-type($image_type)β Sets the image type togif,png,jpeg,gdorgd2. Only useful when--output-format graphis set. The available images types are depending on yourGD::Graphinstallation. Default is'png'.--logo|-l string($logo)β add a custom string to a HTML-Report. It'll be added to a table on the top of the output.-l '<A HREF="https://cord.de/"><IMG BORDER=0 SRC="https://cord.de/sites/default/files/cordlog2n.gif" ALT="Cord"></A>'will add my logo with a link to the Report.
Note:--logoworks only in combination with--output-format htmlorhtml-frame
--meta|-M string($meta)β Meta: adds a custom string or the content of a file into the<HEAD>of a HTML-Report. Useful if you want to add Stylesheets or something to the Report.
Note:--metaworks only in combination with--output-format htmlorhtml-frame
--output-format|-F type[,type[,type[,...]]]($output_format)β Format: sets the format of the output-report. If set to'mail'β adds a subject header to the beginning of the report.'html'β all output is given in html with tables. Can be combined with'mail'to send html mails.'html-frame'β all output is given in html frames with tables.'html-embed'β all output is given in html with tables without HTML-Headers. Useful for Server-Side-Includes.'graph'β enables graphics forhtml,html-embedorhtml-frame.'unformatted'β gives out the raw numbers separated by spaces. Useful for re-using the output in other scripts. If you use this along with-U, the byte values are calculated in the given Unit, and displayed without indication along with the numbers. the indication moves up to the header of the report.
--output-path($output_path)β output calamaris statistics to/path. In case of graph output, the graphics destination is/pathand the filename isindex.html, else it iscalamaris.txt. If--output-pathis not given, all graphics are written to the working directory.--output-file($output_file)β alter the filename of--output-path.--output-file-prefix($output_file_prefix)β adds a prefix to--output-file.%tis replaced by the timerange of the report,%hby the hostname (see--hostname)--show-reports,-Sn[,n[,n[,...]]] ($show_reports) β okay bestie, this one only shows the reports you pick, in the exact order you list them. Default is to display the reports as they are defined through the report-switches above. The following numbers are defined:0β Summary1β Incoming request peak per protocol2β Incoming transfer volume peak per protocol3β Incoming requests by method4β Incoming UDP-requests by status5β Incoming TCP-requests by status6β Outgoing requests by status7β Outgoing requests by destination8β Request-destinations by 2ndlevel-domain9β Request-destinations by toplevel-domain10β TCP-Request-protocol11β Requested content-type12β Requested extensions13β Incoming UDP-requests by host14β Incoming TCP-requests by host15β Size Distribution Diagram16β Performance in n minute steps17β UDP-Request duration distribution in msec18β TCP-Request duration distribution in msec19β UDP Response code distribution20β TCP Response code distribution
Note: Using this doesn't make Calamaris any faster, the internal calculations will be done as the report-switches were set (see above). No cap, it's just cosmetic. π
--sort-order,-O($sort_order) β changes the sort order in the reports to request size, default is sorting by number of requests. So if you want biggest bytes first, this is your girl. π₯($text_color)β defines the colors for text/axis/legend/labels in graphics. (only useful with--output-format graph). Rainbow chart energy. π--unit,-Ustring ($unit) β you can define this toK(ilo),M(ega),G(iga) orT(era) for the Byte-units. Slay those units. π($width)β defines the width of the graphics. height is calculated from this with a3:2-ratio. (only useful with--output-format graph). Math does the height, you just pick the width. π($x_scale)β defines how many datasets should be drawn on the graph.30is a good value, but you can play with this. if$x_scalegets to big, you're on your own ;-) β lowkey chaotic warning, bestie. π--generate-index($generate_index) β generates an index for all reports that match--output-file-prefix. Iconic for navigation. β¨
π Caching π
--cache-input-file,-ifile ($cache_input_file) β you can reuse a cache file generated with--cache-output-filefile to add old data to a new report. Several files can be separated with a:. So like a little cache buffet. π
Note: if you use more than one cache file, make sure they are chronologicaly ordered (oldest first). Chronologicaly is exactly how it's spelled in the original, so no autocorrect, bestie. Note: if you reuse cache-files, which were not created with -d -1 -r -1 -t -1 -R -1 the number of 'others' would be wrong everywhere. In this case the number of 'others' are omitted. Don't say I didn't warn you.
--cache-output-file,-ofile ($cache_output_file) β Calamaris stores a summary of the computed information in file and you can reuse it at a later time with--cache-input-file. It's giving save-state. πΎ
Note: The output file can be the same as the input file: it is simply overwritten after reading the data. It is not recommended to change the options between different runs if you include older data as this can result in strange measurements. Strange measurements sounds like a vibe, but it's not. π
β¨ Misc β¨
--benchmark,-bn ($benchmark) β benchmark: A switch for the impatient as it prints a#for every n parsed lines. So you get little progress hashes. # # # π«Ά--copyright,-Cβ Prints the copyright information of Calamaris. Legal era. π--help,-hβ Prints a brief description of the command line options. Your bestie when you're lost. π--version,-Vβ Prints out the Version-Number. Number goes brrr. β
π Debug π
--dump-loop,-Lβ prints the internal loop toSTDERR. (for Debugging). So if you're nosy, this is for you. π($test)β activates some small tests for the programmer. Dev-only vibes. π§--verbose,-v($verbose) β print more information about what is Calamaris is doing and believing. Yes, believing is the word. Let that sink in. π
π EXAMPLES π
This example mails the daily statistics to root:
cat /var/log/squid/access.log | nice -39 calamaris --all-useful-reports --hostname "daily worf" --output-format mail | mail root
This one only caches a summary for later use:
cat /var/log/squid/access.log | calamaris --all-useful-reports --cache-output-file daily.`date +"%w"` > /dev/null
You can then use the caches to have weekly statistics:
if [ $DAYOFWEEK = "0" ]; then
calamaris --all-useful-reports --cache-input-file daily.1:daily.2:daily.3:daily.4:daily.5:daily.6:daily.0 --no-input --output-format mail --hostname "weekly worf" | mail root ;
fi
π BUGS π
If you have a problem with Calamaris , please make sure that you use the recent version of Calamaris (see VERSION below). Also check that your proxy works correctly and doesn't produce invalid Logfiles. (see the README for buglist and pointers.) Proxy drama is not it.
If you're sure that you've encountered a bug in Calamaris please report it to Calamaris-bug@cord.de. This also applies if Calamaris itself says 'please report this'. So if it's self-snitching, listen. π
π PRIVACY π
Calamaris can be (mis-)used to track what users are requesting. Big Brother energy.
So please read the following and think about it, before using Calamaris to be the Big Brother.
- If you don't trust your users than there is something more wrong than the loss of productivity.
- Squid has some nice acl-mechanisms. If you think that your users don't use the net properly, don't let them use it. (You can also open the net at specific times or to specific sites, if you want.)
- If you still want to use Calamaris that way, let your
vict^Wusersknow, that they'll be monitored. (in Germany you have to let them know!)
π SEE ALSO π
βοΈ AUTHOR βοΈ
Cord Beermann <Cord@Wunder-Nett.org>, Michael Pophal <michael.pophal@nefkom.net>. There are also a lot of people who contributed code, gave ideas or requested features. Look them up in the executable. Icons only.
This man page was written by Philipp Frauenfelder <pfrauenf@debian.org>, maintainer of the Debian package. Maintenance is now taken over by Cord Beermann. π
π¦ VERSION π¦
Version of this manpage: $Id: calamaris.1,v 3.1 2006-03-19 17:52:48 cord Exp $
It describes the usage of Calamaris V3.0 and later.
Information about new releases, mailing lists, and other related issues can be found from the Calamaris home page at URL https://Calamaris.Cord.de/
π«£ WARRANTY π«£
Calamaris comes with "absolutely no warranty". No cap, zero warranty. π
π COPYRIGHT π
Copyright (C) 1997-2006, 2013, 2015, 2017, 2021 Cord Beermann
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
(If you modify and want to publish it under the name Calamaris , please ask me. I don't want to confuse the 'audience' with many different versions of the same name and/or Version number. (This is not part of the license, it is only a favour i asked of you.))
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This page is handmade, dated 2006-03-19 17:52:48, and it's the CALAMARIS(1) manual. Stay slaying, bestie. π
β¨
π¦ where this page comes from
- debian bookworm: calamaris 2.99.4.7-1 Β· GPL-2.0-or-later
- debian trixie: calamaris 2.99.4.8-1 Β· GPL-2.0-or-later
- epel 10: calamaris 2.99.4.8-1.el10_0 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-2.0-or-later
- epel 9: calamaris 2.99.4.8-1.el9 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-2.0-or-later
- fedora 43: calamaris 2.99.4.8-3.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-2.0-or-later
- fedora 44: calamaris 2.99.4.8-5.fc44 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-2.0-or-later
- ubuntu jammy: calamaris 2.99.4.7-1 Β· GPL-2.0-or-later
- ubuntu noble: calamaris 2.99.4.7-1.1 Β· GPL-2.0-or-later
- ubuntu questing: calamaris 2.99.4.8-1
- ubuntu resolute: calamaris 2.99.4.8-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: calamaris 2.99.4.8-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms