Skip to content

Instantly share code, notes, and snippets.

@hewersonfreitas
Created June 11, 2020 18:57
Show Gist options
  • Save hewersonfreitas/ab146d8033f3120e8227e6e71aaf2922 to your computer and use it in GitHub Desktop.
Save hewersonfreitas/ab146d8033f3120e8227e6e71aaf2922 to your computer and use it in GitHub Desktop.
varnish-logs.sh
varnishlog -q '(RespStatus ~ 500 or RespStatus ~ 502 or RespStatus ~ 503)' -i "ReqURL" -I "ReqHeader:Host:" -I "RespHeader:Location:" -i "RespStatus" -I "ReqHeader:Referer:" -a -w /var/log/varnish/varnishlog-errors-500.log -D
varnishncsa -F '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" "%{Cookie}i" "%{Varnish:hitmiss}x" "%{Varnish:time_firstbyte}x"' -a -w /var/log/varnish/cached-miss.log -D
varnishncsa -q '(RespStatus ~ 500 or RespStatus ~ 502 or RespStatus ~ 503)' -a -w /var/log/varnish/varnishncsa-errors-500.log -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment