全部產品
Search
文件中心

Simple Log Service:GetIndex

更新時間:Sep 18, 2026

查詢指定Logstore的索引資訊。

介面說明

介面說明

請求語法中 Host 由 Project 名稱和日誌服務 Endpoint 構成,您需要在 Host 中指定 Project。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

log:GetIndex

get

*LogStore

acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore}

  • log:TLSVersion
無

請求文法

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

路徑參數

名稱

類型

必填

描述

樣本值

logstore

string

是

Logstore 名稱。

test-logstore

請求參數

名稱

類型

必填

描述

樣本值

project

string

是

project 名稱。

ali-test-project

返回參數

名稱

類型

描述

樣本值

object

請求返回的結構體。

index_mode

string

索引類型。

v2

keys

object

欄位索引設定。key 為欄位名稱,value 為索引設定。

object

單一欄位的索引設定。

caseSensitive

boolean

Indicates whether case sensitivity is enabled. This parameter is required only when type is set to text. Valid values:

  • true

  • false

chn

boolean

Indicates whether Chinese characters are included. This parameter is required only when type is set to text. Valid values:

  • true

  • false

token

array

The delimiters.

string

The delimiter. This parameter is required only when type is set to text.

type

string

The data type of the field value. Valid values: text, json, double, and long.

doc_value

boolean

Indicates whether the analytics feature is enabled for the field. Valid values:

  • true

  • false

alias

string

The alias of the field.

lastModifyTime

integer

索引最後更新時間。Unix 時間戳記格式,表示從 1970-1-1 00:00:00 UTC 計算起的秒數。

1524155379

line

object

全文索引設定。

caseSensitive

boolean

是否大小寫敏感。

  • true:大小寫敏感。

  • false:大小寫不敏感。

false

chn

boolean

是否包含中文。

  • true:包含中文。

  • false:不包含中文。

false

exclude_keys

array

排除的欄位清單。

string

排除欄位清單。

excludeField

include_keys

array

包含的欄位清單。

string

包含欄位清單。

includeField

token

array

分詞符清單。

string

分詞符。例如 "," "." "\r" "\n" 等。

,

log_reduce

boolean

是否啟用日誌聚類。

false

log_reduce_black_list

array

日誌聚類的聚類欄位過濾黑名單,僅當日誌聚類啟用時有效。

string

黑名單欄位。

b

log_reduce_white_list

array

日誌聚類的聚類欄位過濾白名單,僅當日誌聚類啟用時有效。

string

白名單欄位。

a

max_text_len

integer

日誌服務預設欄位值的最大長度為 2048 位元組,即 2 KB。如果您需要修改欄位值的最大長度,可設定統計欄位(text)最大長度,取值範圍為 64~16384 位元組。

2048

storage

string

儲存類型,目前固定取值為 pg。

pg

ttl

integer

索引檔案生命週期,支援 7 天、30 天、90 天。

30

樣本

正常返回樣本

JSON格式

{
  "index_mode": "v2",
  "keys": {
    "key": {
      "caseSensitive": false,
      "chn": false,
      "token": [
        ""
      ],
      "type": "",
      "doc_value": false,
      "alias": ""
    }
  },
  "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
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情。