Help Center/ Cloud Search Service/ API Reference/ APIs/ Logstash/ Updating a Configuration File
Updated on 2024-10-17 GMT+08:00

Updating a Configuration File

Function

This API is used to update a configuration file.

Debugging

You can debug this API through automatic authentication in API Explorer.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

cluster_id

Yes

String

ID of the cluster where the configuration file is to be updated.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

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

confContent

Yes

String

Configuration file content.

setting

Yes

setting object

Configure an entity object.

sensitive_words

No

Array of strings

Sensitive character replacement. Enter the list of sensitive character strings to be hidden. After the hidden character string list is configured, the specified strings will be replaced with asterisks (*) in configurations. (Up to 20 strings are allowed, and each can be up to 512 bytes long.)

Table 3 setting

Parameter

Mandatory

Type

Description

workers

No

Integer

Number of working threads in the Filters and Outputs phases of parallel pipelines. The default value is the number of CPU cores.

batchSize

No

Integer

Maximum number of events that a worker thread collects from inputs before attempting to execute its filters and outputs. A larger value is more effective but increases memory overhead. The default value is 125.

batchDelayMs

No

Integer

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

queueType

Yes

String

An internal queue model for event buffering. memory indicates a traditional in-memory queue, and persisted indicates a disk-based ACKed persistent queue. The default value is memory.

queueCheckPointWrites

No

Integer

Maximum number of written events before forcing a checkpoint when persistent queues are enabled. The default value is 1024.

queueMaxBytesMb

No

Integer

Total capacity of the persistent queue in unit of MB. Make sure the capacity of your disk drive is greater than the value you specify here. The default value is 1024 MB.

Response Parameters

None

Example Requests

Update the configuration file.

POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/lgsconf/update

{
  "name" : "conf1",
  "confContent" : "xxxxxxxx",
  "setting" : {
    "workers" : 2,
    "batchSize" : 125,
    "batchDelayMs" : 50,
    "queueType" : "persisted",
    "queueCheckPointWrites" : 1024,
    "queueMaxBytesMb" : 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.