Watch
0
0
Fork
You've already forked hyperhive
0

egress dashboard: match squid's result codes by prefix

"TCP_" alone is a word filter for the token TCP_, which no result code is, so
the overview and refused tabs read zero. "TCP_"* matches TCP_TUNNEL and the
rest. The module-eval case now fails on the bare form.
This commit is contained in:
iris 2026-10-30 16:15:19 +01:00
commit e334e677e0

View file

@ -488,6 +488,13 @@ let
&& lib.length (lib.filter (e: lib.hasInfix access e) exprs) == 14
&& agentVar != null
&& lib.hasInfix access agentVar.spec.query.spec.query
# `"TCP_"` alone is a word filter for the token TCP_, which no result
# code is (TCP_TUNNEL, TCP_MISS, ...): every panel reads zero. The prefix
# form `"TCP_"*` is the one that matches them.
&& lib.all (e: !(lib.hasInfix "\"TCP_\" " e)) (exprs ++ [ agentVar.spec.query.spec.query ])
&& lib.all (e: lib.hasInfix "\"TCP_\"*" e) (
lib.filter (e: lib.hasInfix access e) (exprs ++ [ agentVar.spec.query.spec.query ])
)
&& lib.hasInfix "logformat would_deny would_deny user=%[un method=%rm host=%>rd port=%>rP result=" squid
&& lib.hasInfix "access_log syslog:daemon.info squid !manager" squid;
}