Handy Varnish 4 top and log commands

Written by andrewwidjaja | Published 2017/07/26
Tech Story Tags: varnish | devops | load-balancing | web-development | sysadmin

TLDRvia the TL;DR App

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 URLssudo varnishtop -i BereqURL

View the top IP addressessudo varnishtop -i ReqStart

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

View the top User Agentssudo varnishtop -C -I ReqHeader:User-Agent

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

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


Published by HackerNoon on 2017/07/26