From: git Date: Tue, 5 May 2026 11:56:53 +0000 (-0400) Subject: countconn: fix output being broken with ipv6 clients in the logs X-Git-Url: https://git.datadissipation.net/?a=commitdiff_plain;h=9f01c45ff09e70214131a02b3e569924a5a38aa9;p=logtools.git countconn: fix output being broken with ipv6 clients in the logs --- diff --git a/countconn b/countconn index 0d71501..f6d9105 100755 --- 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"