---
title: Get all indexes
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Logs Indexes
---

# Get all indexes{% #get-all-indexes %}
Copy pageCopied
{% tab title="v1" %}

| Datadog site      | API endpoint                                                 |
| ----------------- | ------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v1/logs/config/indexes |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v1/logs/config/indexes |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/logs/config/indexes      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v1/logs/config/indexes      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v1/logs/config/indexes  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v1/logs/config/indexes     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v1/logs/config/indexes |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v1/logs/config/indexes |

### Overview

The Index object describes the configuration of a log index. This endpoint returns an array of the `LogIndex` objects of your organization. This endpoint requires the `logs_read_config` permission.

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Object with all Index configurations for a given organization.

| Parent field      | Field                                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------- | ---------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                   | indexes                                  | [object] | Array of Log index configurations.                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| indexes           | daily_limit                              | int64    | The number of log events you can send in this index per day before you are rate-limited.                                                                                                                                                                                                                                                                                                                                                                                         |
| indexes           | daily_limit_reset                        | object   | Object containing options to override the default daily limit reset time.                                                                                                                                                                                                                                                                                                                                                                                                        |
| daily_limit_reset | reset_time                               | string   | String in `HH:00` format representing the time of day the daily limit should be reset. The hours must be between 00 and 23 (inclusive).                                                                                                                                                                                                                                                                                                                                          |
| daily_limit_reset | reset_utc_offset                         | string   | String in `(-|+)HH:00` format representing the UTC offset to apply to the given reset time. The hours must be between -12 and +14 (inclusive).                                                                                                                                                                                                                                                                                                                                   |
| indexes           | daily_limit_warning_threshold_percentage | double   | A percentage threshold of the daily quota at which a Datadog warning event is generated.                                                                                                                                                                                                                                                                                                                                                                                         |
| indexes           | exclusion_filters                        | [object] | An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.                                                                                                                                                                                                                                                                            |
| exclusion_filters | filter                                   | object   | Exclusion filter is defined by a query, a sampling rule, and a active/inactive toggle.                                                                                                                                                                                                                                                                                                                                                                                           |
| filter            | query                                    | string   | Default query is `*`, meaning all logs flowing in the index would be excluded. Scope down exclusion filter to only a subset of logs with a log query.                                                                                                                                                                                                                                                                                                                            |
| filter            | sample_attribute                         | string   | Sample attribute to use for the sampling of logs going through this exclusion filter. When set, only the logs with the specified attribute are sampled.                                                                                                                                                                                                                                                                                                                          |
| filter            | sample_rate [*required*]            | double   | Sample rate to apply to logs going through this exclusion filter, a value of 1.0 excludes all logs matching the query.                                                                                                                                                                                                                                                                                                                                                           |
| exclusion_filters | is_enabled                               | boolean  | Whether or not the exclusion filter is active.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| exclusion_filters | name [*required*]                   | string   | Name of the index exclusion filter.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| indexes           | filter [*required*]                 | object   | Filter for logs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| filter            | query                                    | string   | The filter query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| indexes           | is_rate_limited                          | boolean  | A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.                                                                                                                                                                                                                                                                                                                                 |
| indexes           | name [*required*]                   | string   | The name of the index.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| indexes           | num_flex_logs_retention_days             | int64    | The total number of days logs are stored in Standard and Flex Tier before being deleted from the index. If Standard Tier is enabled on this index, logs are first retained in Standard Tier for the number of days specified through `num_retention_days`, and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` is reached. The available values depend on retention plans specified in your organization's contract/subscriptions. |
| indexes           | num_retention_days                       | int64    | The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index. The available values depend on retention plans specified in your organization's contract/subscriptions.                                                                                                                                                                                                                                                     |
| indexes           | tags                                     | [string] | A list of tags associated with the index. Tags must be in `key:value` format.                                                                                                                                                                                                                                                                                                                                                                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "indexes": [
    {
      "daily_limit": 300000000,
      "daily_limit_reset": {
        "reset_time": "14:00",
        "reset_utc_offset": "+02:00"
      },
      "daily_limit_warning_threshold_percentage": 70,
      "exclusion_filters": [
        {
          "filter": {
            "query": "*",
            "sample_attribute": "@ci.job_id",
            "sample_rate": 1
          },
          "is_enabled": false,
          "name": "payment"
        }
      ],
      "filter": {
        "query": "source:python"
      },
      "is_rate_limited": false,
      "name": "main",
      "num_flex_logs_retention_days": 360,
      "num_retention_days": 15,
      "tags": [
        "team:backend",
        "env:production"
      ]
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Curl command curl -X GET "https://api.datadoghq.com/api/v1/logs/config/indexes" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get all indexes returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.logs_indexes_api import LogsIndexesApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = LogsIndexesApi(api_client)
    response = api_instance.list_log_indexes()

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Get all indexes returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::LogsIndexesAPI.new
p api_instance.list_log_indexes()
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Get all indexes returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewLogsIndexesApi(apiClient)
	resp, r, err := api.ListLogIndexes(ctx)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LogsIndexesApi.ListLogIndexes`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `LogsIndexesApi.ListLogIndexes`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Get all indexes returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.LogsIndexesApi;
import com.datadog.api.client.v1.model.LogsIndexListResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsIndexesApi apiInstance = new LogsIndexesApi(defaultClient);

    try {
      LogsIndexListResponse result = apiInstance.listLogIndexes();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsIndexesApi#listLogIndexes");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Get all indexes returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_logs_indexes::LogsIndexesAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = LogsIndexesAPI::with_config(configuration);
    let resp = api.list_log_indexes().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Get all indexes returns "OK" response
 */

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.LogsIndexesApi(configuration);

apiInstance
  .listLogIndexes()
  .then((data: v1.LogsIndexListResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
