Forrest logo
back to the varnishlog tool

varnishlog:tldr:3f2c8

varnishlog: Only display requests to a specific domain.
$ varnishlog -q 'ReqHeader eq "Host: ${example-com}"'
try on your machine

The command "varnishlog -q 'ReqHeader eq "Host: ${example-com}"'" is used to filter the output of the Varnish log based on a specific request header.

Let's break down the command:

  • "varnishlog" is a command-line tool for monitoring and inspecting requests and responses processed by the Varnish cache server.
  • "-q" is an option that allows you to specify a query expression to filter the output.
  • 'ReqHeader eq "Host: ${example-com}"' is the query expression used to filter the log based on the request header.

In this specific command, the query expression is filtering the log entries to only include requests where the "Host" header matches "example.com".

Here's what each part of the query means:

  • "ReqHeader" refers to the request header field that is being checked.
  • "eq" stands for "equals" and is the comparison operator used to compare the value of the "Host" header field to the specified value.
  • "Host: ${example-com}" is the value being compared. In this case, it is comparing the "Host" header field to the value "${example-com}". The "${example-com}" syntax is often used in configuration files to indicate a placeholder for a value that needs to be substituted with an actual value during execution.

Overall, the command is used to display only the log entries that correspond to requests where the "Host" header is equal to "example.com".

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