All Products
Search
Document Center

Simple Log Service:PutLogStoreConfig

Last Updated:Mar 27, 2026

Updates the configuration of a Logstore.

Operation description

  • The Host in the request header must contain both the Project name 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.

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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 appendMeta setting for the Logstore. This setting adds the extracted IP address as a log tag.

string

No

A header key, such as X-Forwarded-For, used to extract the client IP address. The key name is case-insensitive.

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.