Help Center/ Cloud Search Service/ API Reference/ API V1/ Logstash/ Updating a Configuration File
Updated on 2026-08-24 GMT+08:00

Updating a Configuration File

Function

This API is used to update the configuration file of a Logstash cluster.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    css:logstash:confUpdate

    Write

    cluster *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

POST /v1.0/{project_id}/clusters/{cluster_id}/lgsconf/update

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

Constraints

N/A

Range

Project ID of an account. The value contains 32 characters, consisting of lowercase letters and digits.

Default Value

N/A

cluster_id

Yes

String

Definition

ID of the cluster where the configuration file is to be updated. For details about how to obtain the cluster ID, see Obtaining the Cluster ID.

Constraints

N/A

Range

The value is a UUID containing 36 characters.

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition

Configuration file name.

Constraints

N/A

Range

The value can contain 4 to 32 characters and must start with a letter. Only digits, letters, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

conf_content

Yes

String

Definition

Content of the Logstash configuration file.

Constraints

The file size cannot exceed 50 KB.

Range

N/A

Default Value

N/A

setting

Yes

setting object

Definition:

Configure an entity object.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

sensitive_words

No

Array of strings

Definition:

Sensitive character replacement. Enter the sensitive character strings you want to hide. For items that you enter in this box, the corresponding strings will be replaced with *** in the configuration file.

Constraints:

You can enter a maximum of 20 strings, each with a maximum length of 512 bytes.

Value range:

N/A

Default value:

N/A

desc

No

String

Definition

Configuration file description.

Constraints

N/A

Range

The value can contain at most 128 characters.

Default Value

N/A

Table 3 setting

Parameter

Mandatory

Type

Description

workers

No

Integer

Definition

Number of worker threads that execute the Filters and Outputs phase of the pipeline in parallel.

Constraints

N/A

Range

1 to 5 times the number of CPU cores of the node.

Default Value

Number of CPU cores of the node.

batch_size

No

Integer

Definition

Maximum number of events collected from inputs by a single worker thread before executing its filters and outputs. Increasing this value increases memory overhead.

Constraints

N/A

Range

1 to 100000

Default Value

125

batch_delay_ms

No

Integer

Definition:

Minimum waiting time of an event to be scheduled by the pipeline. The unit is millisecond.

Constraints:

N/A

Value range:

1-600000

Default value:

50

queue_type

Yes

String

Definition:

An internal queue for event buffering.

Constraints:

N/A

Value range:

  • memory: a traditional in-memory queue.

  • persisted: a disk-based ACKed persistent queue.

Default value:

N/A

queue_check_point_writes

No

Integer

Definition

Maximum number of written events before forcing a checkpoint when persistent queues are enabled.

Constraints

This parameter takes effect only when queue_type is set to persisted.

Range

1 to 100000

Default Value

1024

queue_max_bytes_mb

No

Integer

Definition

Total capacity (in MB) of a persistent queue if persistent queues are used. Ensure that the disk capacity is greater than the value of this parameter.

Constraints

This parameter takes effect only when queue_type is set to persisted.

Range

1-10240

Default Value

1024

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

Update the configuration file.

POST https://{Endpoint}/v1.0/{project_id}/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/lgsconf/update

{
  "name" : "conf",
  "desc" : "This is a description of a configuration file.",
  "conf_content" : "xxxxxxxx",
  "setting" : {
    "workers" : 2,
    "batch_size" : 125,
    "batch_delay_ms" : 50,
    "queue_type" : "persisted",
    "queue_check_point_writes" : 1024,
    "queue_max_bytes_mb" : 1024
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request.

The client should modify the request instead of re-initiating it.

409

The request cannot be processed due to a conflict.

This status code indicates that the resource that the client attempts to create already exits, or the requested update failed due to a conflict.

412

The server did not meet one of the preconditions contained in the request.

Error Codes

See Error Codes.