Log rows are processed in batches using a fast in memory queue (Redis Streams). On each webserver, set at least two cron jobs to handle updating the cache, converting Redis memory streams to disk and to update the ClickHouse database.
Create a cron job to update the cached settings and convert Redis streams (which contain the log lines) to files.
curl 'https://txtlog.net/cron?updatecache=true&action=cachetofile'
Create another cron job to insert the rows into the ClickHouse database.
curl 'https://txtlog.net/cron?action=filetodatabase'
To combine these, the following code removes the existing cron job for the current user (!), creates the required jobs and runs them every minute.
crontab -r
(
echo "* * * * * curl -s 'https://txtlog.net/cron?updatecache=true&action=cachetofile' >>/tmp/txtlog.cron 2>&1" &&
echo "* * * * * curl -s 'https://txtlog.net/cron?action=filetodatabase' >>/tmp/txtlog.cron 2>&1"
) | crontab -
To use the Geo IP and Tor IP functions, run these commands.
curl 'https://txtlog.net/cron?action=geoipdownload'
curl 'https://txtlog.net/cron?action=geoipparse'
curl 'https://txtlog.net/cron?action=toripdownload'
curl 'https://txtlog.net/cron?action=toripparse'