View session logs

更新时间:
复制 MD 格式

You can view session logs to query sessions between clients and servers. This topic describes how to view session logs in the Database Audit console and the Log Service console.

View session logs in Database Audit

  1. Log on to Database Audit. For more information, see Log on to the Database Audit system.

  2. In the left-side navigation pane, choose Query Analysis > Session Logs.

  3. After selecting search criteria such as asset name and time range, click Query.

  4. Click a Session ID to view session details.

View session logs in the Log Service console

Log Service stores the database session logs audited by Database Audit. The session logs that you view in Database Audit are sourced from Log Service. You can view and download the session log data from the Project and Logstore created by Database Audit in the Log Service console.

Procedure

  1. Log on to the Log Service console.

  2. In the Projects list, find the Project related to Database Audit, and then click the Project name.

    Projects created by Database Audit contain the note "Created by Database Audit. Do not delete." This note helps you identify the correct Project.

  3. On the Logstores page, click the name of the target Logstore.

    Logstores with names that start with dbaudit-session store session logs.

  4. On the details page of the target Logstore, select a time range and view the log details.

    For more information about the log fields, see Log fields.

Log fields

Parameter

Description

uid

The Alibaba Cloud account ID.

iid

The Database Audit instance ID.

si

The session ID.

di

The database ID.

cp

The client IP address.

ct

The client port.

cc

The client MAC address.

dp

The database IP address.

dt

The database port.

dc

The database MAC address.

tm

The timestamp of the session action.

at

The session action. Valid values:

  • -1: Failure

  • 0: Logon

  • 1: Logout

rc

The database response code.

rt

The database response message.

um

The database username.

tl

The tool or application.

om

The OS user.

im

The service name or instance name.