indexes
Creates, updates, deletes, gets or lists an indexes resource.
Overview
| Name | indexes |
| Type | Resource |
| Id | datadog.logs.indexes |
Fields
The following fields are returned by SELECT queries:
- get_logs_index
- list_log_indexes
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the index. (example: main) |
daily_limit | integer (int64) | The number of log events you can send in this index per day before you are rate-limited. |
daily_limit_reset | object | Object containing options to override the default daily limit reset time. |
daily_limit_warning_threshold_percentage | number (double) | A percentage threshold of the daily quota at which a Datadog warning event is generated. |
exclusion_filters | array | 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. |
filter | object | Filter for logs. |
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. |
num_flex_logs_retention_days | integer (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. |
num_retention_days | integer (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. |
tags | array | A list of tags associated with the index. Tags must be in key:value format. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the index. (example: main) |
daily_limit | integer (int64) | The number of log events you can send in this index per day before you are rate-limited. |
daily_limit_reset | object | Object containing options to override the default daily limit reset time. |
daily_limit_warning_threshold_percentage | number (double) | A percentage threshold of the daily quota at which a Datadog warning event is generated. |
exclusion_filters | array | 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. |
filter | object | Filter for logs. |
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. |
num_flex_logs_retention_days | integer (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. |
num_retention_days | integer (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. |
tags | array | A list of tags associated with the index. Tags must be in key:value format. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_logs_index | select | name | Get one log index from your organization. This endpoint takes no JSON arguments. | |
list_log_indexes | select | The Index object describes the configuration of a log index.<br />This endpoint returns an array of the LogIndex objects of your organization. | ||
create_logs_index | insert | name, filter | Creates a new index. Returns the Index object passed in the request body when the request is successful. | |
update_logs_index | replace | name, filter | Update an index as identified by its name.<br />Returns the Index object passed in the request body when the request is successful.<br /><br />Using the PUT method updates your index's configuration by replacing<br />your current configuration with the new one sent to your Datadog organization. | |
delete_logs_index | delete | name | Delete an existing index from your organization. Index deletions are permanent and cannot be reverted.<br />You cannot recreate an index with the same name as deleted ones. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the log index. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
SELECT examples
- get_logs_index
- list_log_indexes
Get one log index from your organization. This endpoint takes no JSON arguments.
SELECT
name,
daily_limit,
daily_limit_reset,
daily_limit_warning_threshold_percentage,
exclusion_filters,
filter,
is_rate_limited,
num_flex_logs_retention_days,
num_retention_days,
tags
FROM datadog.logs.indexes
WHERE name = '{{ name }}' -- required
;
The Index object describes the configuration of a log index.<br />This endpoint returns an array of the LogIndex objects of your organization.
SELECT
name,
daily_limit,
daily_limit_reset,
daily_limit_warning_threshold_percentage,
exclusion_filters,
filter,
is_rate_limited,
num_flex_logs_retention_days,
num_retention_days,
tags
FROM datadog.logs.indexes
;
INSERT examples
- create_logs_index
- Manifest
Creates a new index. Returns the Index object passed in the request body when the request is successful.
INSERT INTO datadog.logs.indexes (
daily_limit,
daily_limit_reset,
daily_limit_warning_threshold_percentage,
exclusion_filters,
filter,
name,
num_flex_logs_retention_days,
num_retention_days,
tags
)
SELECT
{{ daily_limit }},
'{{ daily_limit_reset }}',
{{ daily_limit_warning_threshold_percentage }},
'{{ exclusion_filters }}',
'{{ filter }}' /* required */,
'{{ name }}' /* required */,
{{ num_flex_logs_retention_days }},
{{ num_retention_days }},
'{{ tags }}'
RETURNING
name,
daily_limit,
daily_limit_reset,
daily_limit_warning_threshold_percentage,
exclusion_filters,
filter,
is_rate_limited,
num_flex_logs_retention_days,
num_retention_days,
tags
;
# Description fields are for documentation purposes
- name: indexes
props:
- name: daily_limit
value: {{ daily_limit }}
description: |
The number of log events you can send in this index per day before you are rate-limited.
- name: daily_limit_reset
description: |
Object containing options to override the default daily limit reset time.
value:
reset_time: "{{ reset_time }}"
reset_utc_offset: "{{ reset_utc_offset }}"
- name: daily_limit_warning_threshold_percentage
value: {{ daily_limit_warning_threshold_percentage }}
description: |
A percentage threshold of the daily quota at which a Datadog warning event is generated.
- name: exclusion_filters
description: |
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.
value:
- filter:
query: "{{ query }}"
sample_attribute: "{{ sample_attribute }}"
sample_rate: {{ sample_rate }}
is_enabled: {{ is_enabled }}
name: "{{ name }}"
- name: filter
description: |
Filter for logs.
value:
query: "{{ query }}"
- name: name
value: "{{ name }}"
description: |
The name of the index.
- name: num_flex_logs_retention_days
value: {{ num_flex_logs_retention_days }}
description: |
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.
- name: num_retention_days
value: {{ num_retention_days }}
description: |
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.
- name: tags
value:
- "{{ tags }}"
description: |
A list of tags associated with the index. Tags must be in `key:value` format.
REPLACE examples
- update_logs_index
Update an index as identified by its name.<br />Returns the Index object passed in the request body when the request is successful.<br /><br />Using the PUT method updates your index's configuration by replacing<br />your current configuration with the new one sent to your Datadog organization.
REPLACE datadog.logs.indexes
SET
daily_limit = {{ daily_limit }},
daily_limit_reset = '{{ daily_limit_reset }}',
daily_limit_warning_threshold_percentage = {{ daily_limit_warning_threshold_percentage }},
disable_daily_limit = {{ disable_daily_limit }},
exclusion_filters = '{{ exclusion_filters }}',
filter = '{{ filter }}',
num_flex_logs_retention_days = {{ num_flex_logs_retention_days }},
num_retention_days = {{ num_retention_days }},
tags = '{{ tags }}'
WHERE
name = '{{ name }}' --required
AND filter = '{{ filter }}' --required
RETURNING
name,
daily_limit,
daily_limit_reset,
daily_limit_warning_threshold_percentage,
exclusion_filters,
filter,
is_rate_limited,
num_flex_logs_retention_days,
num_retention_days,
tags;
DELETE examples
- delete_logs_index
Delete an existing index from your organization. Index deletions are permanent and cannot be reverted.<br />You cannot recreate an index with the same name as deleted ones.
DELETE FROM datadog.logs.indexes
WHERE name = '{{ name }}' --required
;