SLOWLOG EXPORT
SLOWLOG EXPORT
- Group
- Server
- Complexity
- O(N) where N is the number of entries
- Arity
- 2 (exactly, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
SLOWLOG EXPORT returns the whole slow log as one JSON document, oldest
entry first. Besides the fields of SLOWLOG GET, each
entry says which ACL user ran the command, in which tenant and in which
database, which makes it easy to send the log to a log pipeline or to find
which team’s workload is slow.
Return value
Section titled “Return value”A bulk string holding a JSON array, in RESP2 and RESP3. Each element is an object:
| Key | Value |
|---|---|
id |
Entry id. |
timestamp |
Unix time in seconds. |
duration_us |
Execution time in microseconds. |
args |
Array of the command’s arguments, shortened as in SLOWLOG GET. |
client_addr |
Client address and port. |
client_name |
Client name, or an empty string. |
username |
ACL user of the connection. |
tenant_id |
Tenant the command ran for, or an empty string. |
database |
Database number. |
Arguments are binary-safe in HotKV but JSON is text: bytes that are not valid UTF-8 are replaced with U+FFFD, so the output always parses.
Examples
Section titled “Examples”127.0.0.1:6379> SLOWLOG EXPORT"[{\"id\":41,\"timestamp\":1790000000,\"duration_us\":15320,\"args\":[\"KEYS\",\"*\"],\"client_addr\":\"10.0.0.21:40118\",\"client_name\":\"reporting\",\"username\":\"default\",\"tenant_id\":\"\",\"database\":0}]"Compatibility
Section titled “Compatibility”HotKV-only subcommand. Redis 7 and Valkey 8 do not have it.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.