Skip to content

[feat](query) Add session_id to audit log #2483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/admin-manual/system-tables/internal_schema/audit_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Store audit logs
| Column Name | Type | Description |
| ----------------- | ------------ | ------------------------------------------------------------ |
| query_id | varchar(48) | ID of the Query |
| time | datetime(3) | Time when the query was executed(in milliseconds) |
| time | datetime(3) | Time when the query was executed(in milliseconds) |
| session_id | varchar(36) | ID of user session the query was executed |
| client_ip | varchar(128) | IP address of the client sending the query |
| user | varchar(128) | User |
| catalog | varchar(128) | Current Catalog during statement execution |
Expand Down Expand Up @@ -73,5 +74,3 @@ Store audit logs

- `client_ip`: If a proxy service is used and the IP pass-through is not enabled, the proxy service IP may be recorded here instead of the real client IP.
- `state`: `EOF` indicates that the query is executed successfully. `OK` indicates that the DDL and DML statements are executed successfully. `ERR` indicates that the statement execution fails.


Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ mysql> desc audit_log;
+-------------------+--------------+------+-------+---------+-------+
| query_id | varchar(48) | Yes | true | NULL | |
| time | datetime | Yes | true | NULL | |
| client_ip | varchar(128) | Yes | true | NULL | |
| session_id | varchar(36) | Yes | true | NULL | |
| client_ip | varchar(128) | Yes | false | NULL | NONE |
| user | varchar(128) | Yes | false | NULL | NONE |
| catalog | varchar(128) | Yes | false | NULL | NONE |
| db | varchar(128) | Yes | false | NULL | NONE |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ under the License.
| :-------------------------- | :----------- | :------------------------------------- |
| query_id | varchar(48) | Query 的 ID。 |
| time | datetime(3) | 查询发生的时间。 |
| session_id | varchar(36) | 执行查询的用户会话的 ID |
| client_ip | varchar(128) | 发送查询的客户端 IP |
| user | varchar(128) | 用户 |
| catalog | varchar(128) | 语句执行时的当前 Catalog |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ mysql> desc audit_log;
+-------------------+--------------+------+-------+---------+-------+
| query_id | varchar(48) | Yes | true | NULL | |
| time | datetime | Yes | true | NULL | |
| client_ip | varchar(128) | Yes | true | NULL | |
| session_id | varchar(36) | Yes | true | NULL | |
| client_ip | varchar(128) | Yes | false | NULL | NONE |
| user | varchar(128) | Yes | false | NULL | NONE |
| catalog | varchar(128) | Yes | false | NULL | NONE |
| db | varchar(128) | Yes | false | NULL | NONE |
Expand Down