Skip to content

Instantly share code, notes, and snippets.

@2ik
Created April 14, 2022 17:22
Show Gist options
  • Save 2ik/83c92778497afd382fe7a9c1f59abc0c to your computer and use it in GitHub Desktop.
Save 2ik/83c92778497afd382fe7a9c1f59abc0c to your computer and use it in GitHub Desktop.
Redis client list group by IP with count

Получить список ip клиентов в редисе с группировкой

redis-cli client list | sed s/addr=//g | sed s/:.*//g | awk '{a[$2]++} END {for (i in a) print i"\t"a[i]}'
127.0.0.1	2
127.0.0.2	1
127.0.0.3	1
127.0.0.4	28
127.0.0.5	16
127.0.0.6	3
127.0.0.7	5
127.0.0.8	16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment