How to debug varnish with varnishlog and regex.

url
Rate this post

Sometimes it’s necessary to understand why some of your rules doesn’t work as intended. Usually it’s pretty trivial, you just run varnishlog, but what to do when you want to check something in live production and there are a lot of hits every single second? Fortunately you can use Regular Expressions and narrow down your varnishlog output.

If you have varnish > 3.0

Look for incoming client request for specific url (/filtered-url)

Trace a backend request for specific url

Notice that it will not work if your backend returns 404.

See all request for specific received Header. For example Hostname

or User Agent (also see a small regex here)

 

You may also like...

Lascia un Commento

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">