| Crates.io | htcount |
| lib.rs | htcount |
| version | 0.3.0 |
| created_at | 2025-06-08 13:28:15.597152+00 |
| updated_at | 2025-06-10 13:08:25.320862+00 |
| description | Simple CLI/daemon tool for counting visitors using access.log and exporting totals in multiple formats, such as JSON or SVG badge |
| homepage | |
| repository | https://github.com/YGGverse/htcount |
| max_upload_size | |
| id | 1704877 |
| size | 25,582 |
Simple CLI/daemon tool for counting visitors using access.log in the Common Log Format
Export totals in multiple formats, such as JSON or SVG badge!
git clone https://github.com/YGGverse/htcount.git && cd htcountcargo build --releasesudo install target/release/htcount /usr/local/bin/htcounthtcount --source /var/log/nginx/access.log\
--target-svg /path/to/badge.svg\
--template-svg /path/to/counter/template.svg
default/counter.svg-d, --debug <DEBUG>
Debug level
* `i` - info * `d` - detailed
[default: i]
--target-json <TARGET_JSON>
Export results to JSON file (e.g. `/path/to/stats.json`)
--target-svg <TARGET_SVG>
Export results to SVG file (e.g. `/path/to/badge.svg`)
* use `{hits}` / `{hosts}` pattern to replace parsed values
--template-svg <TEMPLATE_SVG>
Use custom SVG file template with `{hits}` / `{hosts}` placeholders
[default: default/counter.svg]
-m, --match-time <MATCH_TIME>
Filter records match time pattern (e.g. `%d/%b/%Y`)
-c, --index-capacity <CAPACITY>
Expected memory index capacity
[default: 100]
-i, --ignore-host <IGNORE_HOST>
Exclude host(s) from index
-s, --source <SOURCE>
Access log source (e.g. `/var/nginx/access.log`)
-u, --update <UPDATE>
Update delay in seconds
[default: 300]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
#/etc/systemd/system/htcount.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/htcount --source /var/log/nginx/access.log\
--target-svg /var/www/htcount/visitors.svg\
--template-svg /path/to/default/template.svg\
--ignore-host 127.0.0.1\
--ignore-host 127.0.0.2\
--match-time %%d/%%b/%%Y\
--update 3600\
--debug n
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target
/var/www/htcount directory exists/path/to/default/template.svg with your custom template pathignore-host to skip local host requestsmatch-time argument %d/%b/%Y
%b/%Yaccess.log format% is escaped to %%systemctl daemon-reload - update configurationsystemctl enable - launch on system startupsystemctl restart htcount - start systemd servicesystemctl status htcount - check if service is running