paint-brush
Handy Varnish 4 top and log commandsby@andrewwidjaja
5,533 reads
5,533 reads

Handy Varnish 4 top and log commands

by Andrew WidjajaJuly 26th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

After upgrading to <a href="https://hackernoon.com/tagged/varnish" target="_blank">Varnish</a> 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 <a href="https://hackernoon.com/tagged/log" target="_blank">log</a> examples.
featured image - Handy Varnish 4 top and log commands
Andrew Widjaja HackerNoon profile picture

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/’”