Skip to content

Instantly share code, notes, and snippets.

@jairovadillo
Created November 26, 2019 16:31
Show Gist options
  • Save jairovadillo/a772e1e56174877795e8ff0c4ea61b10 to your computer and use it in GitHub Desktop.
Save jairovadillo/a772e1e56174877795e8ff0c4ea61b10 to your computer and use it in GitHub Desktop.
import redis
from collections import Counter
REDIS_URL =
REDIS_PORT =
REDIS_DB =
REDIS_PASSWORD =
r = redis.StrictRedis(host=REDIS_URL, port=REDIS_PORT, db=REDIS_DB,
password=REDIS_PASSWORD)
result = Counter()
for key in r.scan_iter('*'):
result[':'.join(['*' if p.isdigit() else p for p in key.decode().split(':')])] += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment