This topic describes the fields that are included in audit logs of PolarDB-X databases.
| Field | Type | Description |
| __topic__ | string | The topic of the log. The value is polardbx_sqlaudit. |
| affect_rows | int |
|
| autocommit | int | This field indicates whether the autocommit mode is enabled when the SQL statement is executed. Valid values:
|
| client_ip | string | The IP address of the client that accesses the PolarDB-X instance. |
| client_port | int | The port over which the client accesses the PolarDB-X instance. |
| db_name | string | The name of the database. |
| fail | int | This field indicates whether the SQL query failed. Valid values:
|
| fetched_rows | int | The number of rows that are retrieved from data nodes. |
| hint | string | The hint that is included in the SQL statement. |
| instance_id | string | The ID of the PolarDB-X instance. |
| memory_reject | int | This field indicates whether the execution failed due to an out-of-memory (OOM) issue. Valid values:
|
| response_time | int | The response time. Unit: ms. |
| spm_baseline_id | int | The ID of the SQL plan baseline in the SQL plan management (SPM) system. |
| spm_plan_id | int | The ID of SQL plan in the SPM system. |
| sql | string | The SQL statement that is executed. |
| sql_code | string | The hash value of the SQL template. |
| sql_time | datetime | The point in time in UTC when the system started to execute the SQL statement. The timestamp is displayed in the yyyy-MM-dd HH:mm:ss.SSS format. |
| sql_type | string | The type of the SQL statement. Valid values:
|
| sql_type_detail | string | The name of the SQL parser. |
| trace_id | string | The ID of the SQL query trace. |
| transaction_id | string | The ID of the transaction. |
| transaction_policy | string | The transaction policy based on which the SQL statement is executed. Valid values:
|
| user | string | The name of the Resource Access Management (RAM) user who executed the SQL statement. |
| table_name | string | The tables on which the SQL statement is executed. Multiple table names are separated with commas (,). |
| workload_type | string | The type of the processor that is used when the SQL statement is executed. Valid values:
|