{
  "schema_version": 2,
  "id": "commands/slowlog-get",
  "title": "SLOWLOG GET",
  "url": "https://redis.io/docs/latest/commands/slowlog-get/",
  "summary": "Returns the slow log's entries.",
  "since": "2.2.12",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:09+01:00",
  "page_type": "content",
  "content_hash": "5db247b0d92bd7f7cea54052d2bd521f6104c914913fc805d56c211877628ea1",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The `SLOWLOG GET` command returns entries from the slow log in chronological order.\n\nThe Redis Slow Log is a system to log queries that exceeded a specified execution time.\nThe execution time does not include I/O operations like talking with the client, sending the reply and so forth, but just the time needed to actually execute the command (this is the only stage of command execution where the thread is blocked and can not serve other requests in the meantime).\n\nA new entry is added to the slow log whenever a command exceeds the execution time threshold defined by the `slowlog-log-slower-than` configuration directive.\nThe maximum number of entries in the slow log is governed by the `slowlog-max-len` configuration directive.\n\nBy default the command returns latest ten entries in the log. The optional `count` argument limits the number of returned entries, so the command returns at most up to `count` entries, the special number -1 means return all entries.\n\nEach entry from the slow log is comprised of the following seven values:\n\n1. A unique progressive identifier for every slow log entry.\n2. The unix timestamp at which the logged command was processed.\n3. The amount of time needed for its execution, in microseconds.\n4. The array composing the arguments of the command.\n5. Client IP address and port.\n6. Client name if set via the [`CLIENT SETNAME`](https://redis.io/docs/latest/commands/client-setname) command.\n7. The total number of arguments in the command, including the command name. Added in Redis 8.10.\n\nThe logged argument array (value 4) is truncated when the command has more arguments than the `slowlog-max-argc` configuration directive allows (32 by default). In that case, the last logged element is replaced with a string of the form `... (N more arguments)`. The total argument count (value 7) always reflects the command's original argument count, captured before truncation, so it can be read directly without parsing that string.\n\nThe entry's unique ID can be used in order to avoid processing slow log entries multiple times (for instance you may have a script sending you an email alert for every new slow log entry).\nThe ID is never reset in the course of the Redis server execution, only a server\nrestart will reset it."
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>count</code></summary>\n\nThe number of recent slow-log entries to return. `-1` returns all entries; the default is 10.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "The seventh element of each entry reports the command's total argument count. This is most useful for variadic commands whose logged argument list has been truncated. In the following example, the `slowlog-max-argc` limit is left at its default of 32 and a `SADD` command is issued with 33 arguments (the command name, the key, and 31 members):\n\n[code example]\n\nThe logged argument array (element 4) is truncated to 32 items, with the final item indicating how many more arguments were omitted. The argument count (element 7) still reports the original total of `33`."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | Not supported for [scripts](https://redis.io/docs/latest/develop/programmability). Also, the client IP address, port, and name are not returned by Redis Software. |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): a list of slow log entries per the above format.\n\n**RESP3:**\n\n[Array reply](../../develop/reference/protocol-spec#arrays): a list of slow log entries per the above format."
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "redis> CONFIG SET slowlog-log-slower-than 0\nOK\nredis> SLOWLOG RESET\nOK\nredis> SADD myset 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33\n(integer) 31\nredis> SLOWLOG GET 1\n1) 1) (integer) 12\n   2) (integer) 1752422400\n   3) (integer) 21\n   4)  1) \"SADD\"\n       2) \"myset\"\n       3) \"3\"\n       4) \"4\"\n          ...\n      32) \"... (2 more arguments)\"\n   5) \"127.0.0.1:52276\"\n   6) \"\"\n   7) (integer) 33",
      "section_id": "examples"
    }
  ]
}
