SLOWLOG GET
SLOWLOG GET [count]
- Group
- Server
- Complexity
- O(N) where N is the number of entries returned
- Arity
- -2 (at least 2 words, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
SLOWLOG GET returns the newest entries of the slow log, newest first. By
default it returns 10. Pass a count to get more or fewer, or -1 for all
of them.
Return value
Section titled “Return value”An array of entries, in RESP2 and RESP3. Each entry is an array of six elements:
- A unique id, an integer. Ids keep growing after SLOWLOG RESET, so a monitoring tool can remember the last id it saw.
- The Unix time, in seconds, at which the command was logged.
- The execution time in microseconds.
- The command’s arguments, an array of bulk strings. Long commands are shortened: at most 32 elements (the last one then says how many arguments were left out), each at most 128 bytes followed by how many bytes were left out.
- The client’s address and port,
?:0if unknown. - The client’s name, set with CLIENT SETNAME, or an empty string.
Errors: ERR count should be greater than or equal to -1 for a count that is
not an integer or below -1.
Examples
Section titled “Examples”127.0.0.1:6379> SLOWLOG GET 21) 1) (integer) 41 2) (integer) 1790000000 3) (integer) 15320 4) 1) "KEYS" 2) "*" 5) "10.0.0.21:40118" 6) "reporting"2) 1) (integer) 40 2) (integer) 1789999950 3) (integer) 11002 4) 1) "HGETALL" 2) "big:hash" 5) "10.0.0.22:51522" 6) ""Compatibility
Section titled “Compatibility”Same entry format as Redis 7 and Valkey 8. The user, tenant and database of each entry are in SLOWLOG EXPORT.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.