usage_logs_by_index
Creates, updates, deletes, gets or lists a usage_logs_by_index resource.
Overview
| Name | usage_logs_by_index |
| Type | Resource |
| Id | datadog.organization.usage_logs_by_index |
Fields
The following fields are returned by SELECT queries:
- get_usage_logs_by_index
| Name | Datatype | Description |
|---|---|---|
index_id | string | The index ID for this usage. |
public_id | string | The organization public ID. |
index_name | string | The user specified name for this index ID. |
org_name | string | The organization name. |
event_count | integer (int64) | The total number of indexed logs for the queried hour. |
hour | string (date-time) | The hour for the usage. |
retention | integer (int64) | The retention period (in days) for this index ID. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_usage_logs_by_index | select | start_hr | end_hr, index_name | Get hourly usage for logs by index. |
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. |
start_hr | string (date-time) | Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. |
end_hr | string (date-time) | Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour. |
index_name | array | Comma-separated list of log index names. |
SELECT examples
- get_usage_logs_by_index
Get hourly usage for logs by index.
SELECT
index_id,
public_id,
index_name,
org_name,
event_count,
hour,
retention
FROM datadog.organization.usage_logs_by_index
WHERE start_hr = '{{ start_hr }}' -- required
AND end_hr = '{{ end_hr }}'
AND index_name = '{{ index_name }}'
;