countconn: fix output being broken with ipv6 clients in the logs
authorgit <redacted>
Tue, 5 May 2026 11:56:53 +0000 (07:56 -0400)
committergit <redacted>
Tue, 5 May 2026 11:56:53 +0000 (07:56 -0400)
countconn

index 0d71501f61da063885cfd9eeb845a0c24059524d..f6d910522a59d353a2c2780d17178c6fb646ba4a 100755 (executable)
--- a/countconn
+++ b/countconn
@@ -14,4 +14,4 @@ err() {
 
 [ "$1" -eq "$1" ] 2>/dev/null && NUM="$1" || NUM=30
 
-cut -d: -f2,3 < /var/log/"$SERVER"/access.log | uniq -c | tail -n"$NUM"
+grep -o "\[.*\]" /var/log/"$SERVER"/access.log | cut -d: -f2,3 | uniq -c | tail -n"$NUM"