Mailing List Archive

Varnishlog. Get entries by XID
Hi,

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
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: Varnishlog. Get entries by XID [ In reply to ]
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
Re: Varnishlog. Get entries by XID [ In reply to ]
Hi, Danila

I think this will be helpful for you.
https://www.varnish-cache.org/docs/trunk/whats-new/changes-5.1.html#vxid-in-vsl-queries


Regards,
--
Shohei Tanaka(@xcir)
http://blog.xcir.net/


2017-04-10 22:18 GMT+09:00 Danila Vershinin <ciapnz@gmail.com>:
> Hi,
>
> 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
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: Varnishlog. Get entries by XID [ In reply to ]
Thanks much, Geoff.

Best Regards,
Danila

> On 10 Apr 2017, at 16:36, Geoff Simmons <geoff@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
>