Updates the configuration of a Logstore.
Operation description
-
The
Hostin the request header must contain both theProjectname and the Simple Log Service (SLS) endpoint. -
This operation requires an AccessKey. For more information, see Access Key.
An AccessKey for an Alibaba Cloud account grants full access to all APIs and poses a high security risk. We strongly recommend that you create and use a RAM user for API access and daily operations. The RAM user must have the necessary permissions to operate SLS resources. For more information, see Create a RAM user and grant permissions.
-
Identify the names of the target
Project,Region, andLogstore. For more information, see Manage Project and Manage Logstore.
Permissions
To grant a RAM user or RAM role permission to call this operation, add the Action and Resource in the following table to a permission policy in Resource Access Management (RAM).
| Actions | Resource |
log:PutLogStoreConfig |
acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} |
Try it now
Test
RAM authorization
Request syntax
PUT /logstores/{logstore}/config HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| logstore |
string |
Yes |
The name of the Logstore. |
ali-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. |
|
| clientIpHeaders |
array |
No |
Specifies a list of header keys from which to extract the client IP address during log ingestion. Simple Log Service (SLS) searches these headers in the specified order and uses the first valid IP address that it finds. The key names are case-insensitive, but their order is significant. To use this feature, you must also enable the |
|
|
string |
No |
A header key, such as |
X-Forwarded-For |
The request body must include at least one configuration parameter.
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.