Query audit logs

更新时间:
复制 MD 格式

Lindorm records SQL operations as audit logs, letting you search and filter SQL activity by time range, user, database, and other dimensions.

Prerequisites

Before you begin, ensure that you have:

Note

To check or upgrade your current version, see LindormTSDB version guide and Minor version update.

Audit log types

Lindorm captures three categories of SQL operations:

CategoryFull nameRecorded statementsExcluded statements
DDLData Definition LanguageCREATE DATABASE, CREATE TABLE, ALTER TABLE, DROP TABLE
DMLData Manipulation LanguageSELECT, DELETEINSERT
DCLData Control LanguageGRANT, REVOKE
Note

INSERT operations are excluded from DML audit logs. Design your audit strategy with this boundary in mind.

Audit log retention period

The default log retention period is 180 days. Logs are automatically deleted when the retention period ends.

To change the retention period, see How to change the data retention period.

View audit logs

  1. Log on to the Lindorm console. In the upper-left corner, select the region of the instance. On the Instances page, click the instance ID or click View Instance Details in the Actions column.

  2. In the left navigation pane, click Time Series Engine, then click Audit Logs. For query syntax and analysis options, see View and analyze logs.

Audit log fields

Each audit log entry contains the following fields:

FieldDescription
contentThe content of the request, such as a specific SQL statement
databaseThe name of the database
instance_idThe ID of the Lindorm instance
ipThe IP address of the client
methodThe request method
requestIdThe request ID
requestTimeMsThe response time, in milliseconds (ms)
statusThe status code
uriThe URL of the request
userAgentThe user agent of the client
userNameThe username that initiated the request