---
type: api
title: Get snapshot lifecycle management statistics
description: Get global and policy-level statistics about actions taken by snapshot lifecycle management.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v8/operation/operation-slm-get-stats
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v8/operation/operation-slm-get-stats
products:
  - Elasticsearch
---

# Get snapshot lifecycle management statistics

Authentication: required

Availability: Generally available since 7.5

## Paths

- `GET` `/_slm/stats`

## Description

Get global and policy-level statistics about actions taken by snapshot lifecycle management.

## Required authorization

- Cluster privileges: `manage_slm`

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
- `timeout` (string · default: 30s) — optional
  Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

## Response

`application/json`

- `retention_deletion_time` (string)
- `retention_deletion_time_millis` (number)
- `retention_failed` (number)
- `retention_runs` (number)
- `retention_timed_out` (number)
- `total_snapshots_deleted` (number)
- `total_snapshot_deletion_failures` (number)
- `total_snapshots_failed` (number)
- `total_snapshots_taken` (number)
- `policy_stats` (object[])
  - `policy` (string)
  - `snapshots_taken` (number)
  - `snapshots_failed` (number)
  - `snapshots_deleted` (number)
  - `snapshot_deletion_failures` (number)
## Code examples

#### Console

```console
GET /_slm/stats
```

#### JavaScript

```javascript
const response = await client.slm.getStats();
```

#### Python

```python
resp = client.slm.get_stats()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_slm/stats" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.slm().getStats(g -> g);
```

#### C#

```c#
var response = await client.SnapshotLifecycleManagement.GetStatsAsync();
```

#### PHP

```php
$resp = $client->slm()->getStats();
```

#### Ruby

```ruby
response = client.slm.get_stats
```

## Response examples

#### Get snapshot lifecycle management stats response example1

`application/json`

A successful response from `GET /_slm/stats`.

```json
{
  "retention_runs": 13,
  "retention_failed": 0,
  "retention_timed_out": 0,
  "retention_deletion_time": "1.4s",
  "retention_deletion_time_millis": 1404,
  "policy_stats": [ ],
  "total_snapshots_taken": 1,
  "total_snapshots_failed": 1,
  "total_snapshots_deleted": 0,
  "total_snapshot_deletion_failures": 0
}
```

