All Products
Search
Document Center

Simple Log Service:update_logstore

Last Updated:Jan 13, 2026

Updates the basic information about a logstore.

Prerequisites

Syntax

aliyunlog log update_logstore --project_name=<value> --logstore_name=<value> [--ttl=<value>] [--enable_tracking=<value>] [--shard_count=<value>] [--append_meta=<value>] [--auto_split=<value>] [--max_split_shard=<value>] [--preserve_storage=<value>] [--encrypt_conf=<value>] [--hot_ttl=<value>] [--mode=<value>] [--telemetry_type=<value>] [--infrequent_access_ttl=<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>] [--profile=<value>] [--sign-version=<value>] [--region-id=<value>]

Parameters

The following table describes this command's parameters.

Parameter

Type

Required

Example

Description

--project_name

String

Yes

aliyun-test-project

The name of the project. The project in SLS is used to isolate the resources of different users and control access to specific resources. See Manage projects.

--logstore_name

String

Yes

logstore-a

The name of the logstore. The name must be globally unique. You cannot change the name after you create the project.

The name must meet the following requirements:

  • Can contain lowercase letters, digits, hyphens (-), and underscores (_).

  • Must start with a lowercase letter and end with a lowercase letter or a digit.

  • Must be 3 to 63 characters in length.

--ttl

Integer

No

30

The data retention period. Unit: days. Valid values: 1 to 3650. If you set this parameter to 3650, data is permanently stored. If the specified retention period elapses, log data is deleted.

The data retention period specified by the ttl parameter is the sum of the following time values:

  • The data retention period for the hot storage tier, which is specified by the hot_ttl parameter

  • The data retention period for the Infrequent Access (IA) storage tier, which is specified by the infrequent_access_ttl parameter

  • The data retention period for the Archive storage tier

--shard_count

Integer

No

2

The number of shards. For more information, see Shard range.

--enable_tracking

Boolean

No

true

Enables or disables WebTracking.

  • true: Enable WebTracking.

  • false: Disable WebTracking.

--append_meta

Boolean

No

false

Specifies whether to record the public IP addresses of clients.

  • true: Record the public IP addresses of clients.

  • false: Do not record the public IP addresses of clients.

--auto_split

Boolean

No

true

Enables or disables automatic shard splitting.

  • true: Enable automatic shard splitting.

  • false: Disable automatic shard splitting.

--max_split_shard

Integer

No

64

The maximum number of shards that an auto-split operation can create. Valid values: 1 to 256. This parameter is required if you set the --auto_split parameter to true.

--encrypt_conf

String

No

None

The data structure for encryption settings.

For more information, see EncryptConf.

--telemetry_type

String

No

None

The type of observable data. Valid values:

  • None: logs. This is the default value.

  • Metrics: Time-series data.

--hot_ttl

Integer

No

7

The data retention period for the hot storage tier. Unit: days. The minimum value is 7, and the maximum value cannot exceed the ttl parameter. If you set this parameter to -1, all data is stored in the hot storage tier.

After the data retention period that is specified for the hot storage tier elapses, the data is moved to the IA storage tier. For more information about the storage tiers and movements of data between storage tiers, see Configure intelligent tiered storage.

  • Data in the hot storage tier must be stored for at least seven days before the data can be moved to the IA storage tier. Data in the IA storage tier must be stored for at least 30 days before the data can be moved to the Archive storage tier.

  • Data in the hot storage tier must be stored for at least 30 days before the data can be moved to the Archive storage tier.

--mode

String

No

standard

The type of the logstore. Simple Log Service provides Standard logstores and Query logstores. Valid values:

  • standard (default): Standard logstore. This type of logstore supports the log analysis feature and is suitable for scenarios such as real-time monitoring and interactive analysis. You can use this type of logstore to build a comprehensive observability system.

  • query: Query logstore. This type of logstore supports high-performance query operations. The index traffic fee of a Query logstore is approximately half that of a Standard logstore. Query logstores do not support SELECT statements. Query logstores are suitable for scenarios in which the amount of data is large, the data retention period is long, or log analysis is not required. Data retention periods of weeks or months are considered long.

For more information, see Manage a logstore.

--infrequent_access_ttl

Integer

No

30

The data retention period for the IA storage tier. Unit: days. Data in the IA storage tier must be stored for at least 30 days before the data can be moved to the Archive storage tier. For more information, see Configure intelligent tiered storage.

Important
  • If you change the retention period (--ttl), SLS deletes all expired data within 1 hour. The data volume that is displayed for Usage Details on the homepage of the SLS console is updated the next day. For example, if you change the retention period from five days to one day, SLS deletes the log data of the previous four days within 1 hour.

  • The number of shards (--shard_count) cannot be modified via the update_logstore command. To adjust the number of shards, use the SplitShard or MergeShard operations.

For more information, see Global parameters.

Examples

  • Request

    Modify the logstore-a Logstore by using the default account.

    aliyunlog log update_logstore --project_name="aliyun-test-project" --logstore_name="logstore-a" --ttl=30 --enable_tracking=true
  • Response

    A successful command returns no output. You can then run the following command to query the logstore details:

    aliyunlog log get_logstore --project_name="aliyun-test-project" --logstore_name="logstore-a" --format-output=json

References