This topic describes the fields of SQL audit logs in PolarDB-X.

Log field Description
__topic__ The topic of a log entry. Valid value: drds_audit_log.
instance_id The ID of a PolarDB-X instance.
instance_name The name of a PolarDB-X instance.
owner_id The ID of an Alibaba Cloud account.
region The region where a PolarDB-X instance resides.
db_name The name of a PolarDB-X database.
user The name of a user who executes an SQL statement.
client_ip The IP address of a client that accesses a PolarDB-X instance.
client_port The port number of a client that accesses a PolarDB-X instance.
sql The SQL statement.
trace_id The trace ID of an SQL statement when the statement is executed. If a transaction is executed, it is tracked by using an ID. The ID consists of the trace ID, a hyphen (-), and a number, for example, drdsabcdxyz-1.
sql_code The hash value of a template SQL statement.
hint The hint that is used to execute an SQL statement.
table_name The names of the tables that are involved in a query. Multiple tables are separated by commas (,).
sql_type The type of an SQL statement. Valid values: Select, Insert, Update, Delete, Set, Alter, Create, Drop, Truncate, Replace, and Other.
sql_type_detail The name of an SQL parser.
response_time The response time. Unit: microseconds.
affect_rows The number of affected or returned rows when an SQL statement is executed.
fail Indicates the result that is returned after an SQL statement is executed. Valid values:
  • 0: successful
  • 1: failed
sql_time The time when an SQL statement is executed.