Belirtilen bir Logstore için dizinler oluşturur.
İstek sözdizimi
aliyunlog log create_index --project_name=<value> --logstore_name=<value> --index_detail=<value> [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]
İstek parametreleri
Aşağıdaki tabloda, create_index komutunun zorunlu ve özel parametreleri açıklanmaktadır.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Simple Log Service komut satırı arayüzünün (CLI) genel parametreleri hakkında bilgi için bkz. Genel parametreler.
Örnekler
-
indexdetail.json adlı bir dosya oluşturun. Aşağıdaki örnekte indexdetail.json dosyasının içeriği gösterilmektedir:
{ "keys": { "key1": { "caseSensitive": false, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text", "doc_value": true }, "key2": { "caseSensitive": false, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text", "doc_value": true }, "key3": { "caseSensitive": false, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text", "doc_value": true }, "key4": { "caseSensitive": false, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text", "doc_value": true } }, "storage": "pg", "ttl": 2, "index_mode": "v2", "line": { "caseSensitive": false, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ] } } -
Varsayılan hesabı kullanarak logstore-a adlı bir Logstore için dizinler oluşturun. Aşağıdaki komutu çalıştırın:
aliyunlog log create_index --project_name="aliyun-test-project" --logstore_name="logstore-a" --index_detail="file://./indexdetail.json" -
Dizin ayarlarını sorgulayın. Aşağıdaki komutu çalıştırın:
aliyunlog log get_index_config --project_name="aliyun-test-project" --logstore_name="logstore-a" --format-output=jsonAşağıdaki çıktı döndürülür:
{ "index_mode": "v2", "keys": { "key1": { "caseSensitive": false, "doc_value": true, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text" }, "key2": { "caseSensitive": false, "doc_value": true, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text" }, "key3": { "caseSensitive": false, "doc_value": true, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text" }, "key4": { "caseSensitive": false, "doc_value": true, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ], "type": "text" } }, "lastModifyTime": 0, "line": { "caseSensitive": false, "chn": false, "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t" ] }, "storage": "pg", "ttl": 30 }
Hata kodları
Bir hata mesajı döndürülürse, ilgili API işleminin hata kodlarına göre hatayı düzeltin. Daha fazla bilgi için bkz. Hata kodları.