---
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/4371/api/doc/elasticsearch/v9/operation/operation-slm-get-stats
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-slm-get-stats
products:
  - Elasticsearch
---

# Get snapshot lifecycle management statistics

Availability: 7.5+

## Paths

- `GET` `/_slm/stats`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

## 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 Duration · default: 30s)
  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 Duration · default: 30s)
  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 Duration)
- `retention_deletion_time_millis` (DurationValueUnitMillis)
- `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` ([] SnapshotPolicyStats)
  - `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

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
}
```

