.\" .\" Copyright (c) 2015-2021, Frederic Cambus .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: .\" .\" * Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" .\" * Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd $Mdocdate: February 13 2021 $ .Dt LOGSWAN 1 .Os .Sh NAME .Nm logswan .Nd fast Web log analyzer using probabilistic data structures .Sh SYNOPSIS .Nm .Op Fl ghv .Op Fl d Ar db .Ar logfile .Sh DESCRIPTION .Nm is a fast Web log analyzer using probabilistic data structures. It is targeted at very large log files, typically APIs logs. It has constant memory usage regardless of the log file size, and takes approximatively 4MB of RAM. .Pp Unique visitors counting is performed using two HyperLogLog counters (one for IPv4, and another one for IPv6), providing a relative accuracy of 0.10%. .Pp If .Ar file is a single dash (`-'), .Nm reads from the standard input. .Pp The options are as follows: .Bl -tag -width Ds .It Fl d Ar db Specify path to a GeoIP database. .It Fl g Enable GeoIP lookups. .It Fl h Display usage. .It Fl v Display version. .El .Sh EXAMPLES The following script can be used to process all log files in the current directory and save the output in a file: .Bd -literal -offset indent #!/bin/sh for file in $(ls *.log) do logswan $file > $file.json done exit 0 .Ed .Sh AUTHORS .Nm was written by .An Frederic Cambus .