» 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 "alicloud_log_project" "example" {
  name       = "tf-log"
  description = "created by terraform"
}
resource "alicloud_log_store" "example" {
  project = "${alicloud_log_project.example.name}"
  name       = "tf-log-store"
  description = "created by terraform"
}
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"
      enable_analytics = true
    }
  ]
}

» Argument Reference

The following arguments are supported:

  • project - (Required, ForceNew) The project name to the log store belongs.
  • logstore - (Required, ForceNew) The log store name to the query index belongs.
  • full_text - The configuration of full text index. Valid item as follows:

    • case_sensitive - Whether the case sensitive. Default to false.
    • include_chinese - Whether includes the chinese. Default to false.
    • token - The string of several split words, like "\r", "#"
  • field_search - List configurations of field search index. Valid item as follows:

    • name - (Required) The field name, which is unique in the same log store.
    • type - The type of one field. Valid values: ["long", "text", "double", "json"]. Default to "long".
    • alias - The alias of one field
    • case_sensitive - Whether the case sensitive for the field. Default to false. It is valid when "type" is "text" or "json".
    • include_chinese - Whether includes the chinese for the field. Default to false. It is valid when "type" is "text" or "json".
    • token - The string of several split words, like "\r", "#". It is valid when "type" is "text" or "json".
    • enable_analytics - Whether to enable field analytics. Default to true.

» Attributes Reference

The following attributes are exported:

  • id - The ID of the log store index. It formats of <project>:<logstore>.
  • project - The project name.
  • logstore - Log store name.
  • full_text - The full text index config.
  • field_search - The field search index config.

» Import

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

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