Provides a Datadog Logs Index API resource. This can be used to create and manage Datadog logs indexes.
Note: It is not possible to delete logs indexes through Terraform, so an index remains in your account after the resource is removed from your terraform config. Reach out to support to delete a logs index.
# A sample Datadog logs index resource definition.
resource "datadog_logs_index" "sample_index" {
name = "your index"
daily_limit = 200000
daily_limit_reset {
reset_time = "14:00"
reset_utc_offset = "+02:00"
}
daily_limit_warning_threshold_percentage = 50
retention_days = 7
filter {
query = "*"
}
exclusion_filter {
name = "Filter coredns logs"
is_enabled = true
filter {
query = "app:coredns"
sample_rate = 0.97
}
}
exclusion_filter {
name = "Kubernetes apiserver"
is_enabled = true
filter {
query = "service:kube_apiserver"
sample_rate = 1.0
}
}
}
filter
(Block List, Min: 1, Max: 1) Logs filter (see below for nested schema)name
(String) The name of the index.daily_limit
(Number) The number of log events you can send in this index per day before you are rate-limited.daily_limit_reset
(Block List, Max: 1) Object containing options to override the default daily limit reset time. (see below for nested schema)daily_limit_warning_threshold_percentage
(Number) A percentage threshold of the daily quota at which a Datadog warning event is generated.disable_daily_limit
(Boolean) If true, sets the daily_limit value to null and the index is not limited on a daily basis (any specified daily_limit value in the request is ignored). If false or omitted, the index's current daily_limit is maintained.exclusion_filter
(Block List) List of exclusion filters. (see below for nested schema)retention_days
(Number) The number of days before logs are deleted from this index.id
(String) The ID of this resource.filter
Required:
query
(String) Logs filter criteria. Only logs matching this filter criteria are considered for this index.daily_limit_reset
Required:
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).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).exclusion_filter
Optional:
filter
(Block List) (see below for nested schema)is_enabled
(Boolean) A boolean stating if the exclusion is active or not.name
(String) The name of the exclusion filter.exclusion_filter.filter
Optional:
query
(String) Only logs matching the filter criteria and the query of the parent index will be considered for this exclusion filter.sample_rate
(Number) The fraction of logs excluded by the exclusion filter, when active.Import is supported using the following syntax:
terraform import <datadog_logs_index.name> <indexName>