All Products
Search
Document Center

Simple Log Service:Collect RDS SQL audit logs

Last Updated:Sep 03, 2024

This topic describes how to collect RDS SQL audit logs in the Simple Log Service console.

Prerequisites

Procedure

  1. Log on to the Simple Log Service console.

  2. In the Import Data section, click RDS SQL Audit - Cloud Products.

    image

  3. In the Specify Logstore step, select the project and Logstore that you created, and click Next.

  4. In the Specify Data Source step, complete RAM authorization, enable the data shipping feature, and then click Next.

    Important
    • If you have not authorized Simple Log Service to ship logs, click Authorize next to RAM, and complete the authorization as prompted. After the authorization is completed, the AliyunLogArchiveRole is created. Then, Simple Log Service assumes this RAM role to collect logs.

    • The destination ApsaraDB RDS instance may not appear on the prompted page or the data shipping feature may fail to be enabled. This issue occurs when your ApsaraDB RDS instance does not meet the required conditions. For more information about how to check whether your ApsaraDB RDS instance meets the required conditions, see the Prerequisites section.

    image

  5. In the Query and Analysis Configurations step, click Next.

    By default, the indexing feature is enabled for the Logstore where RDS SQL audit logs are stored, and indexes are configured for the audit logs. For information about how to modify indexes, see Create indexes.

What to do next

  • If you want to monitor and manage SQL statements that are executed on an ApsaraDB RDS for MySQL instance, you can use the SQL Explorer and Audit feature to record and track the execution of SQL statements. For information about how to enable and disable the SQL Explorer and Audit feature in the ApsaraDB RDS console, see Use the SQL Explorer and Audit feature.

  • Simple Log Service provides the CloudLens for RDS application. You can use CloudLens for RDS to check the collection status of SQL audit logs, error logs, and slow query logs for ApsaraDB RDS instances in real time and manage collection configurations in a centralized manner. You can also audit and analyze collected logs and configure alert rules for the logs. For more information, see Usage notes.

  • After RDS SQL audit logs are collected to Simple Log Service, you can query, analyze, download, ship, and transform the logs. You can also configure alert rules for the logs. For more information, see Common operations on logs of Alibaba Cloud services.