GetIndex
Queries the index configurations of a specified Logstore.
Operation description
Operation description
-
The Host in the request syntax consists of the project name and the Simple Log Service endpoint. You must specify the project in the Host.
-
An AccessKey pair is created and obtained. For more information, see AccessKey pair.
The AccessKey pair of an Alibaba Cloud account has access permissions to all API operations, which poses high security risks. Create and use a Resource Access Management (RAM) user to invoke API operations or perform routine O&M. The RAM user must have the permissions to manage Operation logs and the EPS resource in Simple Log Service. For more information, see Create a RAM user and grant authorization.
-
You have identified the project name, region, and Logstore name for the logs you want to query. For more information, see Manage projects and Manage Logstores.
Authentication resources
The following table lists the authentication resources and authorization information of this API operation. You can add this information to the Action element of a Resource Access Management (RAM) access policy statement to grant a Resource Access Management (RAM) user or a RAM role the permissions to invoke this API operation.
| Action | Resource description in the authorization policy |
log:GetIndex | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} |
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
log:GetIndex |
get |
*LogStore
|
|
None |
Request syntax
GET /logstores/{logstore}/index HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| logstore |
string |
Yes |
The name of the Logstore. |
test-logstore |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| project |
string |
Yes |
The name of the project. |
ali-test-project |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| index_mode |
string |
The index type. |
v2 |
| keys |
object |
The field index configurations. The key is the field name, and the value is the index configuration. |
{"key1":{"alias":"test"}} |
| IndexKey |
The index configuration of a single field. |
{ "alias": "test" } |
|
| lastModifyTime |
integer |
The last time when the index was updated. The value is a UNIX timestamp representing the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970. |
1524155379 |
| line |
object |
The full-text index configurations. |
|
| caseSensitive |
boolean |
Specifies whether the index is case-sensitive. Valid values:
|
false |
| chn |
boolean |
Specifies whether the index contains Chinese characters. Valid values:
|
false |
| exclude_keys |
array |
The list of excluded fields. This parameter cannot be specified at the same time as include_keys. |
|
|
string |
The excluded field. |
excludeField |
|
| include_keys |
array |
The list of included fields. This parameter cannot be specified at the same time as exclude_keys. |
|
|
string |
The included field. |
includeField |
|
| token |
array |
The list of delimiters. |
|
|
string |
The delimiter, such as ",", ".", "\r", and "\n". |
, |
|
| log_reduce |
boolean |
Specifies whether LogReduce is enabled. |
false |
| log_reduce_black_list |
array |
The blacklist of fields filtered out by LogReduce. This parameter takes effect only when LogReduce is enabled. |
|
|
string |
The blacklisted field. |
b |
|
| log_reduce_white_list |
array |
The whitelist of fields filtered by LogReduce. This parameter takes effect only when LogReduce is enabled. |
|
|
string |
The whitelisted field. |
a |
|
| max_text_len |
integer |
The default maximum length of a field value in Simple Log Service is 2,048 bytes, which is 2 KB. To modify the maximum length of a field value, you can set the maximum length of a statistical field (text). Valid values: 64 to 16384. Unit: bytes. |
2048 |
| storage |
string |
The storage type. The value is fixed as pg. |
pg |
| ttl |
integer |
The lifecycle of the index file. Valid values: 7, 30, and 90. Unit: days. |
30 |
Examples
Success response
JSON format
{
"index_mode": "v2",
"keys": {
"key": {
"alias": "myAlias",
"caseSensitive": true,
"chn": true,
"doc_value": true,
"embedding": "sls-multilang-v3",
"index_all": true,
"json_keys": {
"key": {
"alias": "myAlias",
"caseSensitive": true,
"chn": true,
"doc_value": true,
"token": [
"|"
],
"type": "text"
}
},
"max_depth": 10,
"token": [
"|"
],
"type": "text",
"vector_index": "high_recall"
}
},
"lastModifyTime": 1524155379,
"line": {
"caseSensitive": false,
"chn": false,
"exclude_keys": [
"excludeField"
],
"include_keys": [
"includeField"
],
"token": [
","
]
},
"log_reduce": false,
"log_reduce_black_list": [
"b"
],
"log_reduce_white_list": [
"a"
],
"max_text_len": 2048,
"storage": "pg",
"ttl": 30
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.