All Products
Search
Document Center

Simple Log Service:UpdateLogStore

Last Updated:Jun 11, 2026

Memperbarui properti penyimpanan log.

Deskripsi operasi

Usage notes

  • Before you update a Logstore, call the GetLogStore operation to retrieve the configuration of the Logstore. Then, modify the configuration and pass it to the UpdateLogStore operation.

  • The Host in the request syntax consists of a project name and a Simple Log Service (SLS) endpoint. You must specify the project in the Host.

  • Obtain an AccessKey pair. For more information, see AccessKey pair.

An AccessKey pair for an Alibaba Cloud account has permissions on all API operations. This poses a high security risk. We recommend that you create and use a Resource Access Management (RAM) user to make API calls or perform routine O&M. The RAM user must be granted the required permissions to operate SLS resources. For more information, see Create and authorize a RAM user.

Authorization

The following table describes the authorization required for this operation. To grant a RAM user or RAM role permission to call this operation, add the required action to the Action element of a RAM policy.

ActionResource description in an authorization policy
log:UpdateLogStoreacs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName}

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

log:UpdateLogStore

update

*LogStore

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

  • log:TLSVersion
  • log:Encrypted
None

Sintaks permintaan

PUT /logstores/{logstore} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

logstore

string

Yes

Nama penyimpanan log.

test-logstore

Parameter permintaan

Parameter

Type

Required

Description

Example

project

string

Yes

Nama proyek.

ali-test-project

body

object

Yes

Badan permintaan.

logstoreName

string

Yes

The name of the Logstore.

test-logstore

shardCount deprecated

integer

No

The number of shards.

Catatan

You cannot update the number of shards with this operation. To change the number of shards, call the SplitShard or MergeShards operation.

2

ttl

integer

Yes

The data retention period. Unit: days. Valid values: 1 to 3650. If you set this parameter to 3650, the data is permanently retained.

30

encrypt_conf EncryptConf

No

The encryption configuration.

autoSplit

boolean

No

Specifies whether to automatically split a shard.

  • true: automatically splits a shard.

  • false: does not automatically split a shard.

true

enable_tracking

boolean

No

Specifies whether to enable web tracking. Default value: false.

  • true: enables web tracking.

  • false: does not enable web tracking.

false

appendMeta

boolean

No

Specifies whether to record public IP addresses. Default value: false.

  • true: records public IP addresses.

  • false: does not record public IP addresses.

false

maxSplitShard

integer

No

The maximum number of shards to which a shard can be split. The value must be an integer from 1 to 256.

Catatan

This parameter is required if autoSplit is set to true.

64

telemetryType deprecated

string

No

The type of observable data. Valid values:

  • None: logs. This is the default value.

  • Metrics: metrics.

None

hot_ttl

integer

No

The retention period of data in the hot tier of the Logstore. Minimum value: 7. Unit: days. Valid values: 7 to 3000. After the retention period of the hot tier ends, the data is moved to the Infrequent Access (IA) storage class. For more information, see Automatic Storage Tiering.

60

mode

string

No

SLS provides two types of Logstores: Standard and Query.

  • standard: supports one-stop data analytics. This type of Logstore is suitable for scenarios such as real-time monitoring, interactive analysis, and building a complete observability system.

  • query: supports high-performance queries. The index traffic cost of a Query Logstore is about half that of a Standard Logstore. However, a Query Logstore does not support SQL analysis. This type of Logstore is suitable for scenarios that involve large data volumes, long retention periods of weeks or months, and no log analysis.

standard

infrequentAccessTTL

integer

No

The retention period for data in the IA storage class. Data in this storage class has no minimum retention period. Data must be stored for at least 30 days before it is moved to Archive storage.

30

shardingPolicy ShardingPolicy

No

The hash-based write configuration.

Elemen respons

Element

Type

Description

Example

Tidak ada yang didefinisikan.

Contoh

Respons sukses

JSONformat

{}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.