{"id":21202992,"url":"https://github.com/fcambus/logswan","last_synced_at":"2026-04-05T18:06:11.858Z","repository":{"id":33375429,"uuid":"37020335","full_name":"fcambus/logswan","owner":"fcambus","description":"Fast Web log analyzer using probabilistic data structures","archived":false,"fork":false,"pushed_at":"2025-03-24T12:33:19.000Z","size":496,"stargazers_count":387,"open_issues_count":0,"forks_count":24,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-13T10:08:05.524Z","etag":null,"topics":["analyzer","hyperloglog","log","web"],"latest_commit_sha":null,"homepage":"https://www.logswan.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fcambus.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-06-07T14:57:37.000Z","updated_at":"2025-03-24T12:32:50.000Z","dependencies_parsed_at":"2024-12-16T16:24:54.175Z","dependency_job_id":"8e82a37e-fd2a-4cf1-bdd0-fca4779ac6ab","html_url":"https://github.com/fcambus/logswan","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcambus%2Flogswan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcambus%2Flogswan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcambus%2Flogswan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcambus%2Flogswan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcambus","download_url":"https://codeload.github.com/fcambus/logswan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analyzer","hyperloglog","log","web"],"created_at":"2024-11-20T20:19:58.898Z","updated_at":"2026-04-05T18:06:11.830Z","avatar_url":"https://github.com/fcambus.png","language":"C","readme":"```\n                                _____\n                            .xiX*****Xix.\n                          .X7'        '4Xk,\n                         dXl            'XX.        .\n                        xXXl             XXl        .\n                        4XXX             XX'\n                       .  ,x            iX'   _,,xxii\n                       |   ²|        ,iX7,xiiXXXXXXXl\n                       |          .xi,xiXXXXXXXXXXXX:\n                       .      ..iXXiXXXXXXXXXXXXXXX7.\n                       .    .xXXXXXXXXXXXXXXX'XXXX7 .\n                       |   ,XXXXXXXXXXXXXXXX'XXX7'  |\n                       :  .XXXXX7*'\"' 2XXX7'XX7'    |\n  __/ \\     _____    ____  \\XX' _____  47'  ___  ___      _____     __\n.\\\\_   \\___/  _  \\__/  _/_______\\  _/______/  /  \\  \\____/  _  \\___/  \\  _____\n. /     __    Y _ __   \\__  _________  _____  \\/\\/   ____ _ _   ______ \\/ __///\n:/       /    |    \\    |'   \\/   \\/    \\/            \\/    Y    \\/   \\    \\  :\n|\\______/\\_________/____|    /\\____     /\\_____/\\_____/\\____|____/\\____\\___/  |\n+--------------------- \\____/ --- \\____/ ----:----------------------h7/dS!----+\n                       .                     |      :\n                       : .                   :      |\n                       | .     Logswan       .      |\n                       | :                       .  |\n                       |_|_______________________|__|\n                         |                       :\n                                                 .\n```\n# Logswan\n\nLogswan is a fast Web log analyzer using probabilistic data structures. It is\ntargeted at very large log files, typically APIs logs. It has constant memory\nusage regardless of the log file size, and takes approximatively 4MB of RAM.\n\nUnique visitors counting is performed using two HyperLogLog counters (one for\nIPv4, and another one for IPv6), providing a relative accuracy of 0.10%.\nString representations of IP addresses are used and preferred as they offer\nbetter precision.\n\nProject design goals include: speed, memory-usage efficiency, and keeping the\ncode as simple as possible.\n\nLogswan is **opinionated software**:\n\n- It only supports the Common Log Format, in order to keep the parsing code\n  simple. It can of course process the Combined Log Format as well (referer\n  and user agent fields will be discarded)\n- It does not split results per day, but log files can be split prior to\n  being processed\n- Input file size and bandwidth usage are reported in bytes, there are no\n  plans to format or round them\n\nLogswan is written with security in mind and is running sandboxed on OpenBSD\n(using pledge). Experimental seccomp support is available for selected\narchitectures and can be enabled by setting the `ENABLE_SECCOMP` variable\nto `1` when invoking CMake. It has also been extensively fuzzed using AFL\nand Honggfuzz.\n\n## Features\n\nCurrently implemented features:\n\n- Counting used bandwidth\n- Counting number of processed lines / invalid lines\n- Counting number of hits (IPv4 and IPv6 hits)\n- Counting visits (unique IP addresses for both IPv4 and IPv6)\n- GeoIP lookups (for both IPv4 and IPv6)\n- Hourly hits distribution\n- HTTP method distribution\n- HTTP protocol distribution\n- HTTP status codes distribution\n\n## Dependencies\n\nLogswan uses the `CMake` build system and requires `Jansson` and `libmaxminddb`\nlibraries and header files.\n\n## Installing dependencies\n\n- OpenBSD: `pkg_add -r cmake jansson libmaxminddb`\n- NetBSD: `pkgin in cmake jansson libmaxminddb`\n- FreeBSD: `pkg install cmake jansson libmaxminddb`\n- macOS: `brew install cmake jansson libmaxminddb`\n- Alpine Linux: `apk add cmake gcc make musl-dev jansson-dev libmaxminddb-dev`\n- Debian / Ubuntu: `apt-get install build-essential cmake libjansson-dev libmaxminddb-dev`\n- Fedora: `dnf install cmake gcc make jansson-devel libmaxminddb-devel`\n\n## Building\n\n\tmkdir build\n\tcd build\n\tcmake ..\n\tmake\n\nLogswan has been successfully built and tested on OpenBSD, NetBSD, FreeBSD,\nmacOS, and Linux with both Clang and GCC.\n\n## Packages\n\nLogswan packages are available for:\n\n- [OpenBSD][1]\n- [NetBSD][2]\n- [FreeBSD][3]\n- [Debian][4]\n- [Ubuntu][5]\n- [Void Linux][6]\n- [Gentoo][7]\n- [Homebrew][8]\n\n### GeoIP2 databases\n\nLogswan looks for GeoIP2 databases in `${CMAKE_INSTALL_PREFIX}/share/dbip` by\ndefault, which points to `/usr/local/share/dbip`.\n\nA custom directory can be set using the `GEOIP2DIR` variable when invoking\nCMake:\n\n\tcmake -DGEOIP2DIR=/var/db/dbip .\n\nThe free Creative Commons licensed DB-IP IP to Country Lite database can be\ndownloaded [here][9].\n\nAlternatively, GeoLite2 Country database from MaxMind can be downloaded free\nof charge [here][10], but require accepting an EULA and is not freely licensed.\n\n## Usage\n\n\tlogswan [-ghv] [-d db] logfile\n\nIf file is a single dash (`-'), logswan reads from the standard input.\n\nThe options are as follows:\n\n\t-d db\tSpecify path to a GeoIP database.\n\t-g\tEnable GeoIP lookups.\n\t-h\tDisplay usage.\n\t-v\tDisplay version.\n\nLogswan outputs JSON data to **stdout**.\n\n## License\n\nLogswan is released under the BSD 2-Clause license. See `LICENSE` file for\ndetails.\n\n## Author\n\nLogswan is developed by Frederic Cambus.\n\n- Site: https://www.cambus.net\n\n## Resources\n\nProject homepage: https://www.logswan.org\n\nGitHub: https://github.com/fcambus/logswan\n\n[1]: https://openports.pl/path/www/logswan\n[2]: https://pkgsrc.se/www/logswan\n[3]: https://www.freshports.org/www/logswan\n[4]: https://packages.debian.org/search?keywords=logswan\n[5]: https://packages.ubuntu.com/search?keywords=logswan\n[6]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/logswan\n[7]: https://packages.gentoo.org/packages/www-misc/logswan\n[8]: https://formulae.brew.sh/formula/logswan\n[9]: https://db-ip.com/db/lite.php\n[10]: https://dev.maxmind.com/geoip/geoip2/geolite2/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcambus%2Flogswan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcambus%2Flogswan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcambus%2Flogswan/lists"}