Fields in logs

Updated at:

This topic describes the audit log fields for PolarDB-X.

Field Name

Value type

Description

__topic__

string

The topic of the log. The format is polardbx_sqlaudit.

affect_rows

int

  • For a DML statement: the number of affected rows.

  • For a query statement: the number of returned rows.

autocommit

int

Indicates whether autocommit is enabled when the SQL statement is executed. Valid values:

  • 0: Disabled

  • 1 or NULL: Enabled

client_ip

string

The IP address of the client that accesses the PolarDB-X instance.

client_port

int

The port used by the client to access the PolarDB-X instance.

db_name

string

The name of the database.

fail

int

Indicates whether the SQL statement execution failed. Valid values:

  • 0: Succeeded

  • 1: Failed

fetched_rows

int

The number of record rows pulled from storage.

hint

string

The hint used in the SQL statement.

instance_id

string

The ID of the PolarDB-X instance.

memory_reject

int

Indicates whether the execution failed due to an out of memory (OOM) error. Valid values:

  • 0: No

  • 1: Yes

response_time

int

The response time, in milliseconds (ms).

spm_baseline_id

int

The ID of the baseline in SQL Plan Management (SPM).

spm_plan_id

int

The ID of the execution plan in SPM.

sql

string

The SQL statement that was executed.

sql_code

string

The hash value of the SQL template.

sql_time

datetime

The time when the SQL statement started to execute. The time is in UTC and the format is yyyy-MM-dd HH:mm:ss.SSS.

sql_type

string

The type of the SQL statement. Valid values:

  • SELECT

  • INSERT

  • DELETE

  • UPDATE

  • SET

  • ALTER

  • CREATE

  • DROP

  • TRUNCATE

  • REPLACE

  • OTHER

sql_type_detail

string

The name of the SQL parser.

trace_id

string

The trace ID of the SQL execution.

transaction_id

string

The ID of the transaction.

transaction_policy

string

The transaction policy used to execute the SQL statement. Valid values:

  • Empty: Transactions are disabled.

  • TSO: Executes PolarDB-X timestamp oracle (TSO) transactions. This is the default value.

  • BEST_EFFORT: Executes PolarDB-X two-phase commit (2PC) transactions.

user

string

The username used to execute the SQL statement.

table_name

string

The tables involved in the SQL statement. If multiple tables are involved, separate the table names with a comma (,).

workload_type

string

The workload type for the SQL execution. Valid values:

  • TP: Transactional processing (TP) workload.

  • Analytical workload (AP)