All Products
Search
Document Center

Simple Log Service:UpdateLogStore

Last Updated:Dec 04, 2025

Updates the properties of a logstore.

Operation description

Usage notes

  • Before you update a logstore, call GetLogStore to obtain its original configurations. Modify the configurations and pass them as a parameter to UpdateLogStore.

  • 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.

  • You must create and obtain an AccessKey pair. For more information, see AccessKey pair.

An AccessKey pair for an Alibaba Cloud account grants permissions for all API operations, which creates a high security threat. We recommend that you create and use a RAM user for API calls or routine O&M. The RAM user must have permissions to operate SLS resources. For more information, see Create and authorize a RAM user.

Authorization

The following table describes the authorization for this operation. Add this information to the Action element of a RAM policy to grant a RAM user or RAM role permissions to call this API.

Action

Resource description in an authorization policy

log:UpdateLogStore

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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

Request syntax

PUT /logstores/{logstore} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

logstore

string

Yes

The logstore name.

test-logstore

Request parameters

Parameter

Type

Required

Description

Example

project

string

Yes

The project name.

ali-test-project

body

object

Yes

The request body.

logstoreName

string

Yes

The logstore name.

test-logstore

shardCountdeprecated

integer

No

The number of shards.

Note

This operation does not support updating the number of shards. You can change the number of shards only by calling the SplitShard or MergeShards operation.

2

ttl

integer

Yes

The data retention period in days. Valid values: 1 to 3650. A value of 3650 indicates that the data is permanently stored.

30

encrypt_conf

EncryptConf

No

The data structure of 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. The default value is false.

  • true: enables web tracking.

  • false: does not enable web tracking.

false

appendMeta

boolean

No

Specifies whether to record public IP addresses. The default value is 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. Valid values: 1 to 256.

Note

This parameter is required if autoSplit is set to true.

64

telemetryTypedeprecated

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 storage layer of the logstore. The minimum value is 7. Unit: days. Valid values: 7 to 3000. After the retention period of the hot storage layer ends, data is converted to the IA storage class. For more information, see Tiered Storage of Hot and Cold Data.

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 amounts of data, long storage periods of weeks or months, and no log analysis requirements.

standard

infrequentAccessTTL

integer

No

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 can be converted to Archive Storage.

30

shardingPolicy

ShardingPolicy

No

Response elements

Element

Type

Description

Example

None defined.

Examples

Success response

JSON format

{}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.