Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

SLOWLOG GET

Last updated
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.

An array of entries, in RESP2 and RESP3. Each entry is an array of six elements:

  1. A unique id, an integer. Ids keep growing after SLOWLOG RESET, so a monitoring tool can remember the last id it saw.
  2. The Unix time, in seconds, at which the command was logged.
  3. The execution time in microseconds.
  4. 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.
  5. The client’s address and port, ?:0 if unknown.
  6. 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.

127.0.0.1:6379> SLOWLOG GET 2
1) 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) ""

Same entry format as Redis 7 and Valkey 8. The user, tenant and database of each entry are in SLOWLOG EXPORT.

SLOWLOG EXPORT, SLOWLOG LEN, SLOWLOG RESET, LATENCY DOCTOR