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:
parent
6b0c06800b
commit
e334e677e0
1 changed files with 22 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue