# SLOWLOG GET

> Return the newest slow log entries.

URL: https://docs.hotkv.com/commands/slowlog-get/

```
SLOWLOG GET [count]
```

- Group: Server
- Complexity: O(N) where N is the number of entries returned
- 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

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](https://docs.hotkv.com/commands/slowlog-reset/index.md), 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](https://docs.hotkv.com/commands/client-setname/index.md), 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

```
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) ""
```

## Compatibility

Same entry format as Redis 7 and Valkey 8. The user, tenant and database of
each entry are in [SLOWLOG EXPORT](https://docs.hotkv.com/commands/slowlog-export/index.md).

## See also

[SLOWLOG EXPORT](https://docs.hotkv.com/commands/slowlog-export/index.md), [SLOWLOG LEN](https://docs.hotkv.com/commands/slowlog-len/index.md),
[SLOWLOG RESET](https://docs.hotkv.com/commands/slowlog-reset/index.md), [LATENCY DOCTOR](https://docs.hotkv.com/commands/latency-doctor/index.md)