Linux servers: the agent
tl-agent is a single static binary (amd64/arm64). It follows your access logs the way tail -F does, handles logrotate, batches and gzips lines, and sends them every 10 s. If the endpoint is unreachable it spools to disk (50 MB). It sends a heartbeat every 5 minutes, so you get an alert if it stops.
Install
curl -fsSL https://getgrowbeat.com/install.sh | sudo sh -s -- --token tl_in_YOUR_TOKEN
Options: --logs "/var/log/nginx/access.log,/var/log/nginx/other.log" (default: auto-detect from nginx -T and common paths), --endpoint URL, --uninstall. Running the command again upgrades the agent in place.
Verify
sudo tl-agent test # parses the last lines and prints the events it would send systemctl status tl-agent journalctl -u tl-agent -n 50
Recommended log format
The default combined format works. Adding $request_time and $host lets us rank bots by the server time they consume:
# /etc/nginx/nginx.conf, inside http { }
log_format tl '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time "$host"';
access_log /var/log/nginx/access.log tl;
Then run sudo nginx -t && sudo systemctl reload nginx.
Two settings that change the numbers
- Behind Cloudflare or a load balancer: configure
real_ip_header, or$remote_addrwill be the proxy's IP and every visitor will look like the same visitor. - Static files: if you set
access_log offfor/static/, we can't confirm that a visitor loaded CSS/JS, so disguised bots can't be separated out. If you can, log at least.cssand.js.
Config
/etc/trafficlens/agent.conf: token, endpoint, logs, format (auto | combined | json), batch_seconds, spool_mb, exclude_ips. Restart the agent after editing: sudo systemctl restart tl-agent.
Troubleshooting
- permission denied on the log: the service runs as user
trafficlens, a member of theadmgroup. Check that the log is group-readable byadm(the Debian/Ubuntu default). - 401 in the journal: the token was rotated or the project was disabled. Put the new token in the config.
- Parse errors: run
tl-agent test. Custom formats needformat = jsonwith nginx'sescape=json.