Skip to content

Instantly share code, notes, and snippets.

Last active September 1, 2023 21:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
TOP and Logs command varnish 4
# Muestro las URL que se envian al backend
varnishtop -i BereqURL
# Muestro los host de peticiones al back
varnishtop -b -I BeReqHeader:Host
# Muestro todas URL peticionadas
varnishtop -i requrl
# Mostrar peticiones metodo
varnishtop -i reqMethod
# Mostrar HTTP status
varnishtop -i respStatus
# Mostrar peticiones metodo enviados al backend
varnishtop -i bereqMethod
# Top IP address
varnishtop -i ReqStart
# Top IP address proxy
varnishtop -C -I ReqHeader:X-Forwarded-For
# Top IP adress cloudflare
varnishtop -C -I ReqHeader:CF-Connecting-IP
# Top IP adress Sucuri Security
varnishtop -C -I ReqHeader:SUCURI-CLIENTIP
# Top Referer
varnishtop -C -I ReqHeader:Referer
# Top user agent
varnishtop -C -I ReqHeader:User-Agent
# Filtrar las redirecciones permanentes (301) y mostrar host url y destino
varnishlog -q "RespStatus ~ 301" -i "ReqURL" -I "ReqHeader:Host:" -I "RespHeader:Location:" -i "RespStatus"
# Filtrar por host, y mostrar ReqURL y Referer
varnishlog -q 'ReqHeader ~ "Host: (www\.)?example\.com"' -i "ReqURL" -I "ReqHeader:Referer:"
# Show the top piped URLs
varnishtop -b -i BereqUrl -q Begin "~" "pipe"
# Show the top missed URLs
varnishtop -i ReqURL -q 'VCL_call eq "MISS"'
# See HIT requests slower than 2 seconds
varnishtop -I Timestamp:Resp -q 'Timestamp:Resp ~ "\ [2-9]\." and VCL_call eq "HIT"'
# See all the logs from a specific domain
varnishlog -q '(ReqHeader:Host ~ "" and ReqURL eq "/") or (BereqHeader:Host ~ "" and BereqURL eq "/")'
# Ver IP cloudflare involucradas en error 403
varnishtop -q "RespStatus ~ 403" -I "ReqHeader:CF-Connecting-IP"
Copy link

# Buscar dirección IP en los logs para traer los datos de ReqHeader
varnishlog -q 'ReqHeader ~ "CF-Connecting-IP:"' -g request -i ReqHeader -I Host

Copy link

marcofbb commented Sep 1, 2023

# Listar todas las URL con error 500 
varnishlog -q "BerespStatus == 500" -i BereqURL -I BereqHeader:Host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment