Collecting varnish stats at the Url Level

Thomas Lecomte thomas.lecomte at
Sat Apr 30 12:31:59 CEST 2016

On Sat, Apr 30, 2016 at 12:19 PM, Debraj Manna <subharaj.manna at> wrote:
> Right now we were able to get varnish stats like cache_hit, cache_miss for
> the overall varnish hits. Is there a way we can get the stats at the url
> level like cache_hit, cache_miss, etc for /discovery/v1/search,
> /discovery/v1/suggest  separately?


Varnish can't do that out of the box. You will have to use std.log()
to log wether the request generated a cache miss or a cache hit, and
then compute the ratio by parsing the output of varnishlog/varnishncsa
(see %{VCL_log:key}x in the varnishncsa manpage).

Thomas Lecomte / Virtual Expo

More information about the varnish-misc mailing list