ALIYUN::SLS::Index is used to create an index for a specified Logstore.

Syntax

{
  "Type": "ALIYUN::SLS::Index",
  "Properties": {
    "ProjectName": String,
    "FullTextIndex": Map,
    "LogstoreName": String,
    "KeyIndices": List,
    "LogReduce": Boolean
  }
}

Properties

Name Type Required Editable Description Validity
ProjectName String Yes No The name of the Log Service project. The name must be 3 to 36 characters in length and can contain lowercase letters, digits, hyphens (-), and underscores (_). It must start and end with a lowercase letter or digit.
FullTextIndex Map Yes Yes The full-text index configuration. None
LogstoreName String Yes No The name of the Logstore. None
KeyIndices List No Yes The field index configuration. Either full-text indexing or field indexing must be enabled.
LogReduce Boolean No Yes Specifies whether to enable LogReduce. Default value: false. None

FullTextIndex syntax

"FullTextIndex": {
  "CaseSensitive": Boolean,
  "Delimiter": String,
  "IncludeChinese": Boolean,
  "Enable": Boolean
}

FullTextIndex properties

Name Type Required Editable Description Validity
Enable String Yes Yes Specifies whether to enable full-text indexing. Default value: true. None
CaseSensitive Boolean No Yes Specifies whether the field is case-sensitive. Default value: false. None
Delimiter String No Yes The delimiter used to separate keywords. Default value: ,'";=()[]{}? @&<>/:\n\t\r. None
IncludeChinese Boolean No Yes Specifies whether to support Chinese word segmentation. Default value: false. None

KeyIndices syntax

"KeyIndices": [
  {
    "Name": String,
    "EnableAnalytics": Boolean,
    "Delimiter": String,
    "CaseSensitive": Boolean,
    "JsonKeyIndices": List,
    "Alias": String,
    "IncludeChinese": Boolean,
    "Type": String
  }
]

KeyIndices properties

Name Type Required Editable Description Validity
Name String Yes No The name of the field. You can use a nested name separated with periods (.). Example: k1.k2.k3
EnableAnalytics Boolean No Yes Specifies whether to enable statistical analysis on the field. Default value: true. None
Delimiter String No Yes The delimiter used to separate keywords. Default value: ,'";=()[]{}? @&<>/:\n\t\r. None
CaseSensitive Boolean No Yes Specifies whether the field is case-sensitive. Default value: false. This parameter is valid only when the Type parameter is set to text or json.
JsonKeyIndices List No Yes The JSON index configuration. Format: [{"key1": "value1", "key2": "value2", ...}]. Supported keys are Name, Alias, Type, and EnableAnalytics.
Alias String No No The alias of the field. None
IncludeChinese Boolean No Yes Specifies whether the field contains Chinese characters. Default value: false. This parameter is valid only when the Type parameter is set to text.
Type String Yes Yes The type of the field. Default value: text. Valid values: text, long, double, and json.

Response parameters

Fn::GetAtt

None

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Index": {
      "Type": "ALIYUN::SLS::Index",
      "Properties": {
        "ProjectName": {
          "Ref": "ProjectName"
        },
        "FullTextIndex": {
          "Ref": "FullTextIndex"
        },
        "LogstoreName": {
          "Ref": "LogstoreName"
        },
        "KeyIndices": {
          "Ref": "KeyIndices"
        },
        "LogReduce": {
          "Ref": "LogReduce"
        }
      }
    }
  },
  "Parameters": {
    "ProjectName": {
      "Type": "String",
      "Description": "Project name:1. Only supports lowercase letters, numbers, hyphens (-) and underscores (_).2. Must start and end with lowercase letters and numbers.3. The name length is 3-63 characters.",
      "MinLength": 3,
      "MaxLength": 63
    },
    "FullTextIndex": {
      "Type": "Map",
      "Description": "Full-text indexing configuration.Full-text indexing and key indexing must have at least one enabled."
    },
    "LogstoreName": {
      "Type": "String",
      "Description": "Logstore name:1. Only supports lowercase letters, numbers, hyphens (-) and underscores (_).2. Must start and end with lowercase letters and numbers.3. The name length is 3-63 characters.",
      "MinLength": 3,
      "MaxLength": 63
    },
    "KeyIndices": {
      "Type": "List",
      "Description": "Key index configurations.Full-text indexing and key indexing must have at least one enabled."
    },
    "LogReduce": {
      "Default": false,
      "Type": "Boolean",
      "Description": "Whether to enable log reduce. Default to false.",
      "AllowedValues": [
        true,
        false
      ]
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Index:
    Type: ALIYUN::SLS::Index
    Properties:
      ProjectName:
        Ref: ProjectName
      FullTextIndex:
        Ref: FullTextIndex
      LogstoreName:
        Ref: LogstoreName
      KeyIndices:
        Ref: KeyIndices
      LogReduce:
        Ref: LogReduce
Parameters:
  ProjectName:
    MinLength: 3
    MaxLength: 63
    Type: String
    Description: Project name:1. Only supports lowercase letters, numbers, hyphens
      (-) and underscores (_).2. Must start and end with lowercase letters and numbers.3.
      The name length is 3-63 characters.
  FullTextIndex:
    Type: Map
    Description: Full-text indexing configuration.Full-text indexing and key indexing
      must have at least one enabled.
  LogstoreName:
    MinLength: 3
    MaxLength: 63
    Type: String
    Description: Logstore name:1. Only supports lowercase letters, numbers, hyphens
      (-) and underscores (_).2. Must start and end with lowercase letters and numbers.3.
      The name length is 3-63 characters.
  KeyIndices:
    Type: List
    Description: Key index configurations.Full-text indexing and key indexing must
      have at least one enabled.
  LogReduce:
    Default: false
    Type: Boolean
    Description: Whether to enable log reduce. Default to false.
    AllowedValues:
    - true
    - false