Updates the indexes for a specified Logstore.

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Request syntax

PUT /logstores/{logstore}/index HTTP/1.1

Request parameters

Parameter Type Location Required Example Description
Object Body No

A short description of struct.

logstoreName String Body Yes logstore-4

The name of the Logstore.

keys Object Body No

The configuration of field indexes. A field index is a key-value pair in which the key specifies the name of the field and the value specifies the value of the field.

token Array of String Body Yes ["\n","\t","\r"]

The list of delimiters. You can specify a delimiter to delimit the content of a field value.

caseSensitive Boolean Body No true

Specifies whether to enable case sensitivity.

  • true: enables case sensitivity.
  • false: does not enable case sensitivity.
chn Boolean Body No false

Specifies whether the field contains Chinese characters. This parameter is required when the type parameter is set to text.

  • true: The field contains Chinese characters.
  • false: The field does not contain Chinese characters.
include_keys Array of String Body No None

The list of included fields. You cannot specify both the include_keys and exclude_keys parameters.

exclude_keys Array of String Body No None

The list of excluded fields. You cannot specify both the include_keys and exclude_keys parameters.

line Object Body No

The configuration for full-text indexing.

type String Body Yes text

The data type of the field.

alias String Body No agent_alias

The alias of the field.

chn Boolean Body No false

Specifies whether the field contains Chinese characters. This parameter is required when the type parameter is set to text.

  • true: The field contains Chinese characters.
  • false: The field does not contain Chinese characters.
token Array of String Body No ["\n","\t","\r"]

The list of delimiters. This parameter is required when the type parameter is set to text.

caseSensitive Boolean Body No true

Specifies whether to enable case sensitivity. This parameter is required when the type parameter is set to text.

  • true: enables case sensitivity.
  • false: does not enable case sensitivity.
doc_value Boolean Body No true

Specifies whether to turn on Enable Analytics.

  • true: turns on Enable Analytics.
  • false: does not turn on Enable Analytics.

Response parameters

Parameter Type Example Description
Server String nginx

The name of the server.

Content-Length String 0

The length of the response body.

Connection String close

Indicates whether the connection is persistent. Valid values:

  • close: The connection is non-persistent. A new TCP connection is established for each HTTP request.
  • keep-alive: The connection is persistent. After a TCP connection is established, the connection remains open, and no more time or bandwidth is consumed to establish new connections.
Access-Control-Allow-Origin String *

Indicates whether code from any origin is allowed to access the resource.

Date String Sun, 27 May 2018 08:25:04 GMT

The time at which the response is returned.

x-log-requestid String 5B0A6B60BB6EE39764D458B5

The unique ID of the request. The ID is generated by Log Service.

Examples

Sample requests

PUT /logstores/<logstoreName>/index HTTP/1.1
Host:ali-test-project.cn-hangzhou.log.aliyuncs.com
Content-Type:application/json

{
  "logstoreName" : "logstore-4",
  "keys" : {
    "token" : [ "[\"\\n\",\"\\t\",\"\\r\"]" ],
    "caseSensitive" : true,
    "chn" : false
  },
  "include_keys" : [ "None" ],
  "exclude_keys" : [ "None" ],
  "line" : {
    "type" : "text",
    "alias" : "agent_alias",
    "chn" : false,
    "token" : [ "[\"\\n\",\"\\t\",\"\\r\"]" ],
    "caseSensitive" : true,
    "doc_value" : true
  }
}

Sample success responses

JSON format

HTTP/1.1 200 OK

Error codes

For a list of error codes, visit the API Error Center.