Overview
audit_log_path specifies the output directory for audit logs.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can use theALTER SYSTEM SETstatement to modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | String |
| Default Value | "" which is an empty string by default. In this case, the default path is used.${WORK_DIR}/audit. |
| Value range |
|
| Modifiable | Yes, you can use theALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | No, the setting takes effect immediately. |
Usage instructions
Local storage scenarios
In the same tenant, audit logs from different OBServer nodes are output to different directories. In the same cluster, users may set the output path for different tenants to be the same. In this case, a
tenant_idsubdirectory is added to the directory structure. The local output directory structure is shown in the following figure:- ${audit_log_path} - tenant_id_1 - ip1:port1 - audit.log.20231031080646317[.zst] - audit.log.20231031084835263[.zst] - audit.log - ip2:port2 - audit.log.20231031072457838[.zst] - audit.log.20231031093023607[.zst] - audit.log.20231031101213751[.zst] - audit.log - tenant_id_2Cloud storage scenarios
OceanBase AI Database supports scenarios where multiple OBServer nodes write output to the same
s3/nfsdirectory. Considering that concurrent append writes to files require local file operations for subsequent compression and encryption, only archived files are stored in cloud storage. Append writes are performed to files in the localauditdirectory. When downstream systems consume audit logs from cloud storage, some of the most recent records are only present locally on the OBServer and are not visible to downstream systems.
Configuration example
Configure the audit log output directory to
file:///logs/audit.obclient> ALTER SYSTEM SET audit_log_path='file:///logs/audit';Configure the audit log output directory to
s3://ob-audit/audit/?host=$S3_HOST&access_id=$S3_ACCESS_ID&access_key=$S3_ACCESS_KEY.obclient> ALTER SYSTEM SET audit_log_path = 's3://ob-audit/audit/?host=$S3_HOST&access_id=$S3_ACCESS_ID&access_key=$S3_ACCESS_KEY';