Queries the indexes of a specified Logstore.

Request syntax

GET /project/<projectName>/logstores/<logstoreName>/index HTTP/1.1
Authorization: <AuthorizationString>
x-log-bodyrawsize: 0
User-Agent: <UserAgent>
x-log-apiversion: 0.6.0
Host: <Project Endpoint>
x-log-signaturemethod: hmac-sha1
Date: <GMT Date>
Content-Type: application/x-protobuf
Connection: Keep-Alive

Request parameters

  • Request headers

    The GetIndex operation does not have operation-specific request headers. For information about the common request headers of Log Service API operations, see Common request headers.

  • Parameters
    Parameter Type Required Example Description
    projectName string Yes project-t The name of the project.
    logstoreName string Yes logstore-4 The name of the Logstore.

Response parameters

  • Response headers

    The GetIndex operation does not have operation-specific response headers. For information about the common response headers of Log Service API operations, see Common response headers.

  • Response elements
    If the GetIndex operation succeeds, the response body contains the indexes of the specified project and Logstore. The following table describes the parameters of the response body.
    Parameter Type Example Description
    index_mode string v2 The type of the index.
    keys dict None. The field search configuration. It contains one or more key-value indexes, where the key is the field name and the value is the field value.
    line object None. The full-text index configuration.
    storage string pg The storage type. Default value: pg.
    ttl int 30 The time to live (TTL) of the index file. Valid values: 7, 30, and 90. Unit: days.
    lastModifyTime int 1524155379 The time when the index configuration was last modified. This value is a UNIX timestamp.
    The following table describes the full-text index configuration.
    Parameter Type Example Description
    caseSensitive bool false Specifies whether the field is case-sensitive.
    chn bool false Specifies whether the field contains Chinese characters.
    token array ["\n","\t","\r"] The list of delimiters.
    include_keys array None. The list of included fields.
    exclude_keys array None. The list of excluded fields.
    The following table describes the field search configuration.
    Parameter Type Example Description
    type string text The type of the field.
    alias string None. The alias of the field.
    chn bool false Specifies whether the field contains Chinese characters. This parameter takes effect only when the value of the type parameter is text.
    token array ["\n","\t","\r"] The list of delimiters. This parameter takes effect only when the value of the type parameter is text.
    caseSensitive bool false Specifies whether the field is case-sensitive. This parameter takes effect only when the value of the type parameter is text.
    doc_value bool true Specifies whether to enable the analytics feature for the index.

Examples

  • Sample requests
    GET /project/project-t/logstores/logstore-4/index HTTP/1.1
    Authorization: LOG <yourAccessKeyId>:<yourSignature>
    x-log-bodyrawsize: 0
    User-Agent: sls-java-sdk-v-0.6.1
    x-log-apiversion: 0.6.0
    Host: my-project.cn-shanghai.log.aliyuncs.com
    x-log-signaturemethod: hmac-sha1
    Date: Sun, 06 May 2018 13:08:42 GMT
    Content-Type: application/x-protobuf
    Connection: Keep-Alive
  • Sample success responses
    HTTP/1.1 200
    Server: nginx/1.12.1
    Content-Type: application/json
    Content-Length: 712
    Connection: close
    Access-Control-Allow-Origin: *
    Date: Sun, 06 May 2018 13:08:42 GMT
    x-log-requestid: 5AEEFE5A8B8AEB5E6C82B395
    {
      "index_mode": "v2",
      "keys": {
        "agent": {
          "alias": "",
          "caseSensitive": false,
          "chn": false,
          "doc_value": true,
          "token": [
            ",",
            " ",
            "'",
            "\"",
            ";",
            "=",
            "(",
            ")",
            "[",
            "]",
            "{",
            "}",
            "?",
            "@",
            "&",
            "<",
            ">",
            "/",
            ":",
            "\n",
            "\t",
            "\r"
          ],
          "type": "text"
        },
        "bytes": {
          "alias": "",
          "doc_value": true,
          "type": "long"
        },
        "remote_ip": {
          "alias": "",
          "caseSensitive": false,
          "chn": false,
          "doc_value": true,
          "token": [
            ",",
            " ",
            "'",
            "\"",
            ";",
            "=",
            "(",
            ")",
            "[",
            "]",
            "{",
            "}",
            "?",
            "@",
            "&",
            "<",
            ">",
            "/",
            ":",
            "\n",
            "\t",
            "\r"
          ],
          "type": "text"
        },
        "response": {
          "alias": "",
          "doc_value": true,
          "type": "long"
        }
      },
      "line": {
        "caseSensitive": false,
        "chn": false,
        "token": [
          ",",
          " ",
          "'",
          "\"",
          ";",
          "=",
          "(",
          ")",
          "[",
          "]",
          "{",
          "}",
          "?",
          "@",
          "&",
          "<",
          ">",
          "/",
          ":",
          "\n",
          "\t",
          "\r"
        ]
      },
      "storage": "pg",
      "ttl": 30,
      "lastModifyTime": 1524155379
    }

Error codes

HTTP status code Error code Error message Description
400 IndexConfigNotExist index config doesn’t exist. The error message returned because the specified index does not exist.
404 ProjectNotExist The Project does not exist : {Project}. The error message returned because the specified project does not exist.
404 LogStoreNotExist logstore {logstoreName} dose not exist. The error message returned because the specified Logstore does not exist.
500 InternalServerError Specified Server Error Message. The error message returned because an internal server error has occurred.

For more information about the error codes, see Common error codes.