Forrest logo
back to the varnishlog tool

varnishlog:tldr:78252

varnishlog: Only display requests to a specific path.
$ varnishlog -q 'ReqURL eq "${-path}"'
try on your machine

The command varnishlog -q 'ReqURL eq "${-path}"' is used to view Varnish HTTP cache logs and filter the output to show only the request URLs that match the given criteria.

Here's a breakdown of the command:

  • varnishlog: This is the command-line tool used to monitor and display Varnish cache activity and logs.
  • -q: This option is used to specify a query string to filter the output based on specific criteria.
  • 'ReqURL eq "${-path}"': This is the query string itself. It filters the log output based on the condition that the requested URL (ReqURL) should be equal (eq) to the value of the variable -path.

In Varnish, the ${...} syntax is used to reference variables. In this case, the ${-path} is a built-in variable that represents the path component of the requested URL. By using ${-path} in the query, it checks if the requested URL's path matches the value of ${-path} exactly.

So, when running the command, it will display the log entries that have request URLs matching the value of the ${-path} variable.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the varnishlog tool