Update a Logstore
Run a CLI command to update the configuration of a specified Logstore.
Usage notes
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-storecommand to obtain the current configuration, and then specify all parameters.We recommend that you use the
--cli-dry-runoption 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 |
|
String |
Yes |
aliyun-test-project |
The name of the project. |
|
String |
Yes |
aliyun-test-logstore |
The name of the Logstore. |
|
String |
Yes |
aliyun-test-logstore |
The name of the Logstore. This value must be the same as the value of |
|
Integer |
Yes |
30 |
The data retention period. Unit: days. |
|
Integer |
No |
2 |
The number of shards. |
|
Boolean |
No |
true |
Specifies whether to enable automatic shard splitting. |
|
Integer |
No |
256 |
The maximum number of shards for automatic splitting. |
|
String |
No |
standard |
The type of the Logstore. |
|
Integer |
No |
0 |
The retention period of data in the hot storage tier. Unit: days. |
|
Boolean |
No |
false |
Specifies whether to record the public IP address of the client. |
|
Boolean |
No |
false |
Specifies whether to enable the WebTracking feature. |
|
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.