{
  "id": "last",
  "title": "Latest shards stats requests",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/shards/stats/last/",
  "summary": "Most recent shard statistics requests",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-shards-stats-last) | `/v1/shards/stats/last` | Get most recent stats for all shards |\n| [GET](#get-shard-stats-last) | `/v1/shards/stats/last/{uid}` | Get most recent stats for a specific shard |\n\n## Get latest stats for all shards {#get-all-shards-stats-last}\n\n\tGET /v1/shards/stats/last\n\nGet most recent statistics for all shards.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_all_shard_stats]() |\n\n### Request {#get-all-request} \n\n#### Example HTTP request\n\n\tGET /v1/shards/stats/last?interval=1sec\u0026stime=015-05-27T08:27:35Z \n\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n\n### Response {#get-all-response} \n\nReturns most recent [statistics]() for all shards.\n\n#### Example JSON body\n\n```json\n{\n   \"1\": {\n      \"interval\": \"1sec\",\n      \"stime\": \"2015-05-28T08:27:35Z\",\n      \"etime\": \"2015-05-28T08:28:36Z\",\n      \"used_memory_peak\": 5888264.0,\n      \"used_memory_rss\": 5888264.0,\n      \"read_hits\": 0.0,\n      \"pubsub_patterns\": 0.0,\n      \"no_of_keys\": 0.0,\n      \"mem_size_lua\": 35840.0,\n      \"last_save_time\": 1432541051.0,\n      \"sync_partial_ok\": 0.0,\n      \"connected_clients\": 9.0,\n      \"avg_ttl\": 0.0,\n      \"write_misses\": 0.0,\n      \"used_memory\": 5651440.0,\n      \"sync_full\": 0.0,\n      \"expired_objects\": 0.0,\n      \"total_req\": 0.0,\n      \"blocked_clients\": 0.0,\n      \"pubsub_channels\": 0.0,\n      \"evicted_objects\": 0.0,\n      \"no_of_expires\": 0.0,\n      \"interval\": \"1sec\",\n      \"write_hits\": 0.0,\n      \"read_misses\": 0.0,\n      \"sync_partial_err\": 0.0,\n      \"rdb_changes_since_last_save\": 0.0\n   },\n   \"2\": {\n      \"interval\": \"1sec\",\n      \"stime\": \"2015-05-28T08:27:40Z\",\n      \"etime\": \"2015-05-28T08:28:45Z\",\n      \"// additional fields...\"\n   }\n}\n```\n\n### Status codes {#get-all-status-codes} \n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | No error |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | No shards exist |\n\n## Get latest shard stats {#get-shard-stats-last}\n\n\tGET /v1/shards/stats/last/{int: uid}\n\nGet most recent statistics for a specific shard.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_shard_stats]() |\n\n### Request {#get-request} \n\n#### Example HTTP request\n\n\tGET /v1/shards/stats/last/1?interval=1sec\u0026stime=2015-05-28T08:27:35Z \n\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the shard requested. |\n\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec. (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n\n### Response {#get-response} \n\nReturns the most recent [statistics]() for the specified shard.\n\n#### Example JSON body\n\n```json\n{\n   \"1\": {\n      \"interval\": \"1sec\",\n      \"stime\": \"2015-05-28T08:27:35Z\",\n      \"etime\": \"2015-05-28T08:27:36Z\",\n      \"used_memory_peak\": 5888264.0,\n      \"used_memory_rss\": 5888264.0,\n      \"read_hits\": 0.0,\n      \"pubsub_patterns\": 0.0,\n      \"no_of_keys\": 0.0,\n      \"mem_size_lua\": 35840.0,\n      \"last_save_time\": 1432541051.0,\n      \"sync_partial_ok\": 0.0,\n      \"connected_clients\": 9.0,\n      \"avg_ttl\": 0.0,\n      \"write_misses\": 0.0,\n      \"used_memory\": 5651440.0,\n      \"sync_full\": 0.0,\n      \"expired_objects\": 0.0,\n      \"total_req\": 0.0,\n      \"blocked_clients\": 0.0,\n      \"pubsub_channels\": 0.0,\n      \"evicted_objects\": 0.0,\n      \"no_of_expires\": 0.0,\n      \"interval\": \"1sec\",\n      \"write_hits\": 0.0,\n      \"read_misses\": 0.0,\n      \"sync_partial_err\": 0.0,\n      \"rdb_changes_since_last_save\": 0.0\n   }\n}\n```\n\n### Status codes {#get-status-codes} \n\n| Code | Description |\n|------|-------------|\n| [200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok) | No error |\n| [404 Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found) | Shard does not exist |\n| [406 Not Acceptable](https://www.rfc-editor.org/rfc/rfc9110.html#name-406-not-acceptable) | Shard isn't currently active |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

