How Do I Find Specified Keys and Traverse All Keys?
Finding Specified Keys
Big key and hot key analysis does not support key searching with specified conditions. To find keys with the specified prefix or suffix, use the SCAN command.
For example, to search for keys that contain the letter a in a Redis instance, run the following command in redis-cli:
./redis-cli -h {redis_address} -p {port} [-a password] --scan --pattern '*a*'
Traversing All Keys
Do not use the KEYS command to traverse all keys of an instance because the KEYS command is complex and may block Redis. To traverse all keys in a DCS Redis instance, run the following command in redis-cli:
./redis-cli -h {redis_address} -p {port} [-a password] --scan --pattern '*'
For details about the SCAN command, visit the Redis official website.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.