alicloud_log_store_index

Log Service provides the LogSearch/Analytics function to query and analyze large amounts of logs in real time. You can use this function by enabling the index and field statistics. Refer to details

Example Usage

Basic Usage

resource "random_integer" "default" {
  max = 99999
  min = 10000
}

resource "alicloud_log_project" "example" {
  name        = "terraform-example-${random_integer.default.result}"
  description = "terraform-example"
}

resource "alicloud_log_store" "example" {
  project               = alicloud_log_project.example.name
  name                  = "example-store"
  shard_count           = 3
  auto_split            = true
  max_split_shard_count = 60
  append_meta           = true
}

resource "alicloud_log_store_index" "example" {
  project  = alicloud_log_project.example.name
  logstore = alicloud_log_store.example.name
  full_text {
    case_sensitive = true
    token          = " #$^*\r\n\t"
  }
  field_search {
    name             = "terraform-example"
    enable_analytics = true
    type             = "text"
    token            = " #$^*\r\n\t"
  }
}

Module Support

You can use the existing sls module to create SLS project, store and store index one-click, like ECS instances.

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

Log store index can be imported using the id, e.g.

$ terraform import alicloud_log_store_index.example tf-log:tf-log-store