Varnishlog. Get entries by XID

Danila Vershinin ciapnz at gmail.com
Tue Apr 11 02:50:20 CEST 2017


Thanks much, Geoff.

Best Regards,
Danila

> On 10 Apr 2017, at 16:36, Geoff Simmons <geoff at uplex.de> wrote:
> 
> On 04/10/2017 03:18 PM, Danila Vershinin wrote:
>> 
>> Say I have stumbled upon a "Backend Fetch Failed” page and that
>> gives me an XID.
>> 
>> How do I easily query varnishlog for corresponding client and
>> backend requests?
>> 
>> varnishlog -q “XID = 12345” doesn’t work
> 
> It can be done you're running Varnish 5.1:
> 
> https://www.varnish-cache.org/docs/5.1/whats-new/changes-5.1.html#vxid-in-vsl-queries
> 
> The left-hand side is named 'vxid', and remember to use '==' as the
> comparison operator ('=' is an error):
> 
> $ varnishlog -q “vxid == 12345”
> 
> In versions prior to 5.1 you can use the X-Varnish header:
> 
> # client side
> varnishlog -d -q 'RespHeader:X-Varnish[1] == 12345'
> 
> # backend side
> varnishlog -d -q 'BereqHeader:X-Varnish == 12345'
> 
> 
> HTH,
> Geoff
> -- 
> ** * * UPLEX - Nils Goroll Systemoptimierung
> 
> Scheffelstraße 32
> 22301 Hamburg
> 
> Tel +49 40 2880 5731
> Mob +49 176 636 90917
> Fax +49 40 42949753
> 
> http://uplex.de
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20170411/d06e9d21/attachment.html>


More information about the varnish-misc mailing list