Note
- For V4.3.x, this parameter is available starting with V4.3.3.
- For V4.2.x, this parameter is available starting with V4.2.4.
Description
audit_log_path specifies the output directory for audit logs.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support audit logs.
Privilege requirements
Query the parameter
The
systenant and all user tenants can query this parameter by using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify the parameter
The
systenant and user tenants can modify this parameter by using theALTER SYSTEM SETstatement.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | String |
| Default value | "" by default, which indicates the default path ${WORK_DIR}/audit. |
| Value range |
|
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No. The setting takes effect immediately. |
Considerations
Local storage
The audit logs of different OBServer nodes in the same tenant are output to different directories. In the same cluster, users can set the output paths of different tenants to the same directory. In this case, the directory structure contains a
tenant_idlayer. The directory structure for local output is as follows:- ${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
OceanBase Database supports multiple OBServer nodes outputting audit logs to the same
oss/nfsdirectory. To ensure the performance of concurrent append writes and the subsequent compression and encryption operations, only archived files are stored in cloud storage. Append writes are performed to files in the localauditdirectory. When downstream consumers access audit logs in cloud storage, some of the latest records may only exist on the local OBServer nodes and are not visible to downstream consumers.
Examples
Set the output directory for audit logs to
file:///logs/audit.obclient> ALTER SYSTEM SET audit_log_path='file:///logs/audit';Set the output directory for audit logs to
oss://ob-audit/audit/?host=$OSS_HOST&access_id=$OSS_ACCESS_ID&access_key=$OSS_ACCESS_KEY.obclient> ALTER SYSTEM SET audit_log_path = 'oss://ob-audit/audit/?host=$OSS_HOST&access_id=$OSS_ACCESS_ID&access_key=$OSS_ACCESS_KEY';
