為指定 Logstore 建立索引。
介面說明
Host 由 Project 名稱和日誌服務 Endpoint 構成,您需要在 Host 中指定 Project。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
log:CreateIndex |
create |
*LogStore
|
|
無 |
請求文法
POST /logstores/{logstore}/index HTTP/1.1
路徑參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| logstore |
string |
是 |
Logstore 的名稱。 |
ali-logstore-test |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| project |
string |
是 |
Project 名稱。 |
ali-project-test |
| body |
object |
否 |
請求訊息體。 |
|
| keys |
object |
否 |
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 index configuration of the field. You must specify this parameter, the line parameter, or both parameters. For more information, see Example. |
|
|
object |
否 |
The index configuration of the field. |
||
| caseSensitive |
boolean |
否 |
Specifies whether to enable case sensitivity. This parameter is required only when type is set to text. Valid values:
|
|
| chn |
boolean |
否 |
Specifies whether to include Chinese characters. This parameter is required only when type is set to text. Valid values:
|
|
| type |
string |
否 |
The data type of the field value. Valid values: text, json, double, and long. |
|
| alias |
string |
否 |
The alias of the field. |
|
| token |
array |
否 |
The delimiters that are used to split text. |
|
|
string |
否 |
The delimiter. |
||
| doc_value |
boolean |
否 |
Specifies whether to turn on Enable Analytics for the field. |
|
| line |
object |
否 |
The configuration of full-text indexes. You must specify this parameter, the keys parameter, or both parameters. For more information, see Example. |
|
| chn |
boolean |
否 |
Specifies whether to include Chinese characters. Valid values:
|
|
| caseSensitive |
boolean |
否 |
Specifies whether to enable case sensitivity. Valid values:
|
|
| token |
array |
是 |
The delimiters. You can specify a delimiter to delimit the content of a field value. For more information about delimiters, see Example. |
|
|
string |
否 |
The delimiter. You can specify a delimiter to delimit the content of a field value. For more information about delimiters, see Example. |
||
| include_keys |
array |
否 |
The included fields. You cannot specify both include_keys and exclude_keys. |
|
|
string |
否 |
The included field. You cannot specify both include_keys and exclude_keys. |
||
| exclude_keys |
array |
否 |
The excluded fields. You cannot specify both include_keys and exclude_keys. |
|
|
string |
否 |
The excluded field. You cannot specify both include_keys and exclude_keys. |
||
| ttl |
integer |
否 |
The retention period of logs. Unit: days. Valid values: 7, 30, and 90. |
|
| max_text_len |
integer |
否 |
The maximum length of a field value that can be retained. Default value: 2048. Unit: bytes. The default value is equal to 2 KB. You can change the value of max_text_len. Valid values: 64 to 16384. |
|
| log_reduce |
boolean |
否 |
Specifies whether to turn on LogReduce. After you turn on LogReduce, either the whitelist or blacklist takes effect. |
|
| log_reduce_white_list |
array |
否 |
The fields in the whitelist that you want to use to cluster logs. |
|
|
string |
否 |
The field in the whitelist that you want to use to cluster logs. |
||
| log_reduce_black_list |
array |
否 |
The fields in the blacklist that you want to use to cluster logs. |
|
|
string |
否 |
The field in the blacklist that you want to use to cluster logs. |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
當前API暫無返回參數
樣本
正常返回樣本
JSON格式
{}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。