Updates the properties of a Logstore.
Operation description
Usage notes
Before you update a Logstore, call the GetLogStore operation to retrieve the configuration of the Logstore. Then, modify the configuration and pass it to the UpdateLogStore operation.
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.
Obtain an AccessKey pair. For more information, see AccessKey pair.
An AccessKey pair for an Alibaba Cloud account has 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 make API calls or perform routine O&M. The RAM user must be granted the required permissions to operate SLS resources. For more information, see Create and authorize a RAM user.
Obtain the project name, the Logstore name, and the region where the project resides. For more information, see Manage projects and Manage Logstores.
Authorization
The following table describes the authorization required for this operation. To grant a RAM user or RAM role permission to call this operation, add the required action to the Action element of a RAM policy.
| Action | Resource description in an authorization policy |
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. |
|
| logstoreName |
string |
Yes |
The name of the Logstore. |
test-logstore |
shardCount
deprecated
|
integer |
No |
The number of shards. Note
You cannot update the number of shards with this operation. To change the number of shards, call the SplitShard or MergeShards operation. |
2 |
| ttl |
integer |
Yes |
The data retention period. Unit: days. Valid values: 1 to 3650. If you set this parameter to 3650, the data is permanently retained. |
30 |
| encrypt_conf | EncryptConf |
No |
The encryption configuration. |
|
| autoSplit |
boolean |
No |
Specifies whether to automatically split a shard.
|
true |
| enable_tracking |
boolean |
No |
Specifies whether to enable web tracking. Default value: false.
|
false |
| appendMeta |
boolean |
No |
Specifies whether to record public IP addresses. Default value: false.
|
false |
| maxSplitShard |
integer |
No |
The maximum number of shards to which a shard can be split. The value must be an integer from 1 to 256. Note
This parameter is required if autoSplit is set to true. |
64 |
telemetryType
deprecated
|
string |
No |
The type of observable data. Valid values:
|
None |
| hot_ttl |
integer |
No |
The retention period of data in the hot tier of the Logstore. Minimum value: 7. Unit: days. Valid values: 7 to 3000. After the retention period of the hot tier ends, the data is moved to the Infrequent Access (IA) storage class. For more information, see Automatic Storage Tiering. |
60 |
| mode |
string |
No |
SLS provides two types of Logstores: Standard and Query.
|
standard |
| infrequentAccessTTL |
integer |
No |
The retention period for data in 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 is moved to Archive storage. |
30 |
| shardingPolicy | ShardingPolicy |
No |
The hash-based write configuration. |
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.