Updates the attributes of a Logstore.
Operation description
Operation description
Before updating a Logstore, call the GetLogStore operation to obtain the current Logstore configuration. Modify the configuration as needed and pass it as parameters to the UpdateLogStore operation.
The Host in the request syntax consists of the project name and the Simple Log Service endpoint. Specify the project in the Host.
An AccessKey pair has been created and obtained. For more information, see AccessKey pair.
An Alibaba Cloud account AccessKey pair has access 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 call API operations or perform routine O&M. The RAM user must have the required permissions on Simple Log Service EPS resources. For more information, see Create a RAM user and authorization.
You have determined the project name, region, and Logstore name for the logs you want to query. For more information, see Manage a project and Manage a Logstore.
Operation logs are generated when you call this operation.
Authentication resources
The following table lists the authorization information for this API operation. You can add the information to the Action element in a RAM access policy statement to grant a Resource Access Management (RAM) user or RAM role the permissions to invoke this API operation.
| Action | Resource |
log:UpdateLogStore | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} |
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
log:UpdateLogStore |
update |
*LogStore
|
|
None |
Request syntax
PUT /logstores/{logstore} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| logstore |
string |
Yes |
The name of the Logstore. |
test-logstore |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| project |
string |
Yes |
The name of the project. |
ali-test-project |
| body |
object |
Yes |
The request body parameters. |
|
| logstoreName |
string |
Yes |
The name of the Logstore. |
test-logstore |
shardCount
deprecated
|
integer |
No |
The number of shards. Note
This operation does not support updating the number of shards. You can modify the number of shards only by calling the SplitShard or MergeShards operation. |
2 |
| ttl |
integer |
Yes |
The data retention period. Unit: days. Valid values: 1 to 3650. A value of 3650 indicates permanent retention. |
30 |
| encrypt_conf | EncryptConf |
No |
The encryption configuration. Encryption is disabled by default. Example 1 (enable default encryption):
Example 2 (enable BYOK encryption): |
|
| autoSplit |
boolean |
No |
Specifies whether to enable automatic sharding. After this feature is enabled, a shard is automatically split when the write traffic continuously exceeds the limit, which improves write capacity. You must set maxSplitShard (the maximum number of shards after splitting) when you enable automatic sharding. |
true |
| enable_tracking |
boolean |
No |
Specifies whether to enable the WebTracking feature. Default value: false. You can use the WebTracking feature to collect and analyze user behavior data in browsers or mini programs, such as page views, purchase records, and time on site.
|
false |
| appendMeta |
boolean |
No |
Specifies whether to record the public IP address and log arrival time. Default value: false.
|
false |
| maxSplitShard |
integer |
No |
The maximum number of shards for automatic sharding. Minimum value: 1. Maximum value: 256. Note
This parameter is required when autoSplit is set to true. |
64 |
telemetryType
deprecated
|
string |
No |
The type of observable data. The default value is log data. Valid values:
|
None |
| hot_ttl |
integer |
No |
The retention period of data in the hot tier of the Logstore. Unit: days. Minimum value: 7. The value cannot exceed the value of ttl. By default, all data within the retention period is stored in the hot tier. After the data storage time exceeds the configured hot data retention period, the data is moved to the infrequent access (IA) tier. When you enable the IA tier, the hot data retention period must be at least 7 days. For more information, see Intelligent tiering. Examples:
|
60 |
| mode |
string |
No |
Simple Log Service provides two types of Logstores: Standard and Query.
|
standard |
| infrequentAccessTTL |
integer |
No |
Infrequent access (IA) tier. No minimum storage time is required. Data must be stored for at least 30 days before being moved to the archive tier. When the log retention period exceeds the sum of the hot tier retention period and the IA tier retention period, the remaining storage time is converted to archive tier storage. Examples:
|
30 |
| shardingPolicy | ShardingPolicy |
No |
The hash-based write configuration. When data is written, logs are routed to shards based on the configured hash policy. Before configuring this parameter, ensure that the hash ranges of shards are evenly distributed. This configuration may affect write capacity. Proceed with caution. |
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.