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

Creating a Configuration File

Function

This API is used to create a configuration file in a Logstash cluster. The file defines a data migration solution for a Logstash cluster. Based on this configuration file, the Logstash cluster can ingest data from multiple data sources and migrate the data to the specified destinations. A maximum of 50 configuration files can be created for a single 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:submitConf

    Write

    cluster *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

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

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 created. 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

Configuration file content.

Constraints

Less than 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 will execute the Filters and Outputs stages of the pipeline in parallel.

Constraints

N/A

Range

1 to 5 times the number of the node's vCPUs

Default Value

CPU cores of a node

batch_size

No

Integer

Definition:

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.

Constraints:

N/A

Value range:

1-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 is available only when queue_type=persisted.

Value range:

1-40960

Default value:

1024

queue_max_bytes_mb

No

Integer

Definition:

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

Constraints:

This parameter is available only when queue_type=persisted.

Value range:

1-100000

Default value:

1024

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

Configure an entity object.

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

{
  "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.