Update a Logstore

Updated at:

Run a CLI command to update the configuration of a specified Logstore.

Usage notes

Important

The update-log-store command overwrites the existing configuration. Parameters that are not specified are reset to their default values.

  • Before you run this command, run the get-log-store command to obtain the current configuration, and then specify all parameters.

  • We recommend that you use the --cli-dry-run option to verify the parameters before you run the command.

Command syntax

aliyun sls update-log-store --project=<value> --logstore=<value> --logstore-name=<value> --ttl=<value> [--shard-count=<value>] [--auto-split=<value>] [--max-split-shard=<value>] [--mode=<value>] [--hot-ttl=<value>] [--append-meta=<value>] [--enable-tracking=<value>] [--infrequent-access-ttl=<value>]

Parameters

The following table describes the required and command-specific parameters.

Parameter

Type

Required

Example

Description

--project

String

Yes

aliyun-test-project

The name of the project.

--logstore

String

Yes

aliyun-test-logstore

The name of the Logstore.

--logstore-name

String

Yes

aliyun-test-logstore

The name of the Logstore. This value must be the same as the value of --logstore.

--ttl

Integer

Yes

30

The data retention period. Unit: days.

--shard-count

Integer

No

2

The number of shards.

--auto-split

Boolean

No

true

Specifies whether to enable automatic shard splitting.

--max-split-shard

Integer

No

256

The maximum number of shards for automatic splitting.

--mode

String

No

standard

The type of the Logstore.

--hot-ttl

Integer

No

0

The retention period of data in the hot storage tier. Unit: days.

--append-meta

Boolean

No

false

Specifies whether to record the public IP address of the client.

--enable-tracking

Boolean

No

false

Specifies whether to enable the WebTracking feature.

--infrequent-access-ttl

Integer

No

0

The retention period of data in the Infrequent Access storage tier. Unit: days.

For information about global parameters, see Global parameters.

Command examples

  • Step 1: Obtain the current configuration

aliyun sls get-log-store --project="aliyun-test-project" --logstore="aliyun-test-logstore"
  • Step 2: Update the configuration

Change appendMeta to true and leave all other parameters unchanged:

aliyun sls update-log-store \
  --project="aliyun-test-project" \
  --logstore="aliyun-test-logstore" \
  --logstore-name="aliyun-test-logstore" \
  --ttl 30 \
  --append-meta true \
  --auto-split true \
  --enable-tracking false \
  --hot-ttl 0 \
  --infrequent-access-ttl 0 \
  --max-split-shard 256 \
  --mode standard

References

  • If the server-side response contains an error message when you call an API operation, the API call has failed. You can refer to the API error code table to find a solution. For more information, see PutLogs.

  • Alibaba Cloud OpenAPI Explorer provides debugging tools, software development kits (SDKs), examples, and documentation. You can use OpenAPI Explorer to quickly debug Simple Log Service API operations without manually constructing requests or signing them. For more information, see OpenAPI Explorer.

API reference

UpdateLogStore