Getting Started
Varnish cache
Prepare Varnish request logs and install the Honeylog sender.
Use this guide when Varnish Cache handles visits to the website. The installation requires access to the server terminal. If you do not manage the Varnish server yourself, send this guide together with the private Honeylog installation page to your hosting provider or server administrator.
#Before you begin
The person completing the installation must be able to run commands with administrator permissions on the server that runs Varnish. They also need the ingestion secret shown in Honeylog under Settings > Installation > Varnish.
#Step 1: Install the Honeylog Varnish client
- In Honeylog, open the website, go to
Settings > Installation, and chooseVarnish. - Check that the website address is correct and save the details.
- Copy the generated install command and run it in the terminal of the server that runs Varnish.
- When the terminal asks for the Honeylog ingestion secret, paste the secret shown on the installation page and press Enter. The secret is hidden while you type.
- Wait for the command to finish without errors.
You do not need to configure a log format by hand. The installer creates the two services Honeylog needs: one records visits from Varnish and the other sends them to Honeylog.
Install script:
Install command:
The public example below uses SITE_DOMAIN as a placeholder. Run the personalized command shown under Settings > Installation > Varnish in Honeylog.
read -rsp "Honeylog ingestion secret: " HONEYLOG_INGESTION_SECRET
echo
export HONEYLOG_INGESTION_SECRET
export CLIENT_BASE_URL='https://api.honeylog.io/clients'
export HONEYLOG_API_URL='https://api.honeylog.io/events'
export HONEYLOG_SITE_DOMAIN='SITE_DOMAIN'
export HONEYLOG_LOG_PATH='/var/log/varnish/honeylog_access.log'
export HONEYLOG_SITE_SCHEME='https'
export HONEYLOG_EVENT_NAME='pageview'
export HONEYLOG_SKIP_PATH_REGEX='\.(?:css|js|mjs|map|png|jpe?g|gif|svg|ico|webp|avif|woff2?|ttf|eot|otf|xml|txt)$'
export HONEYLOG_BATCH_SIZE='100'
export HONEYLOG_TIMEOUT_MS='10000'
export HONEYLOG_POLL_INTERVAL_SECONDS='30'
export HONEYLOG_LOG_MAX_SIZE='100M'
export HONEYLOG_LOG_ROTATE_COUNT='14'
curl -fsSL "$CLIENT_BASE_URL/varnish/install.sh" | bash
#Step 2: Verify the installation
Run the following commands on the server:
sudo systemctl status honeylog-varnishncsa.service --no-pager
sudo journalctl -u honeylog-varnishncsa.service -n 100 --no-pager
sudo systemctl status honeylog-varnish.service --no-pager
sudo journalctl -u honeylog-varnish.service -n 100 --no-pager
Both service statuses should show active (running). Then open a few public pages through Varnish, wait about one minute, and confirm that the visits appear in Honeylog. If either service is not active or the visits do not appear, send the command output to the person responsible for the server or to Honeylog support.