index_order
Creates, updates, deletes, gets or lists an index_order resource.
Overview
| Name | index_order |
| Type | Resource |
| Id | datadog.logs.index_order |
Fields
The following fields are returned by SELECT queries:
- get_logs_index_order
| Name | Datatype | Description |
|---|---|---|
index_names | array | Array of strings identifying by their name(s) the index(es) of your organization. Logs are tested against the query filter of each index one by one, following the order of the array. Logs are eventually stored in the first matching index. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_logs_index_order | select | Get the current order of your log indexes. This endpoint takes no JSON arguments. | ||
update_logs_index_order | replace | index_names | This endpoint updates the index order of your organization.<br />It returns the index order object passed in the request body when the request is successful. |
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 |
|---|---|---|
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_order
Get the current order of your log indexes. This endpoint takes no JSON arguments.
SELECT
index_names
FROM datadog.logs.index_order
;
REPLACE examples
- update_logs_index_order
This endpoint updates the index order of your organization.<br />It returns the index order object passed in the request body when the request is successful.
REPLACE datadog.logs.index_order
SET
index_names = '{{ index_names }}'
WHERE
index_names = '{{ index_names }}' --required
RETURNING
index_names;