Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Log Information Queries/ Enabling Log Ingestion to LTS for Instances in Batches (RDS for MySQL)
Updated on 2025-09-24 GMT+08:00

Enabling Log Ingestion to LTS for Instances in Batches (RDS for MySQL)

Function

This API is used to enable log ingestion to LTS for instances in batches.

Constraints

  • You can configure log streams for a maximum of 20 instances at a time. If you configure log streams for audit logs, you can specify a maximum of 10 instances at a time.
  • You cannot repeatedly configure LTS log streams for the same type of logs of an instance in a single request.
  • Each log stream supports only one log type. For example, if audit logs have been configured for a log stream, slow query logs or error logs cannot be configured for this log stream. You cannot configure multiple log types for a given log stream in a single request.
  • When configuring LTS log streams for audit logs, RDS for MySQL DB instances must meet the following kernel version requirements:
    • 5.6: 5.6.43 or later for instances using cloud disks
    • 5.7: 5.7.23 or later for instances using cloud disks
    • 8.0: all kernel versions

URI

  • URI format

    POST /v3/{project_id}/{engine}/instances/logs/lts-configs

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    engine

    Yes

    Definition

    Instance engine to be queried.

    Constraints

    Only the MySQL engine is supported.

    Range

    mysql

    Default Value

    N/A

Request Parameters

Table 2 Parameters

Parameter

Mandatory

Type

Description

log_configs

Yes

Array of objects

Definition

Instance log configurations. For details, see Table 3.

Constraints

N/A

Table 3 log_configs field data structure description

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Definition

Instance ID.

Constraints

N/A

Range

N/A

Default Value

N/A

log_type

Yes

String

Definition

Log type.

Constraints

N/A

Range

  • error_log: error logs
  • slow_log: slow query logs
  • audit_log: audit logs

Default Value

N/A

lts_group_id

Yes

String

Definition

LTS log group ID.

Constraints

N/A

Range

N/A

Default Value

N/A

lts_stream_id

Yes

String

Definition

LTS log stream ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Example Request

Enable log ingestion to LTS for RDS for MySQL instances in batches.

POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/mysql/instances/logs/lts-configs

{
 "log_configs": [
  {
   "instance_id": "2b1d07d2c9c04d62a95d627c607dbbfein01",
   "log_type": "audit_log",
   "lts_group_id": "8aa6cc4e-847b-48a0-ab26-d0c07c95c7ee",
   "lts_stream_id": "c0be9298-95c5-48d7-af99-b5b2aeebb433"
  }
 ]
}

Response

Status Code

Error Code

For details, see Error Codes.