Handy Varnish 4 top and log commands

July 26th 2017
Author profile picture

@andrewwidjajaAndrew Widjaja

After upgrading to Varnish 4, I discovered that my old Varnish 3 top and log commands no longer worked and found it difficult to find a list of Varnish 4 top and log examples.

Below are some Varnish 4 top and log commands that I use often and have found useful.

View the top requested backend URLs
sudo varnishtop -i BereqURL

View the top IP addresses
sudo varnishtop -i ReqStart

View the top X-Forwarded-For IP addresses
sudo varnishtop -C -I ReqHeader:X-Forwarded-For

View the top User Agents
sudo varnishtop -C -I ReqHeader:User-Agent

View requests for a particular host
varnishlog -q “BereqHeader ~ ‘^Host: example.com’”

View requests for a specific URL
varnishlog -q “ReqURL ~ ‘/my/path/’”



The Noonification banner

Subscribe to get your daily round-up of top tech stories!