Created
September 7, 2013 19:41
-
-
Save tsabat/6478597 to your computer and use it in GitHub Desktop.
a unique list of all connected redis clients
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis-cli client list | awk '{print $1}' | sed s/addr=//g | sed s/:.*//g | uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
uniq
only works when the data is already sorted, usesort -u
If you want a count of unique clients, use:
redis-cli CLIENT LIST | awk '{print $2}' | sed s/:.*//g | sort -u | wc -l