You can centrally create and manage log service configurations in a project for use by Events and SQL audit. This topic describes how to add, view, modify, and delete these configurations.
Prerequisites
- You are a Project Admin or have project configuration permissions.
- You have created a Project and Logstore in Alibaba Cloud Simple Log Service (SLS) to receive logs and prepared an Access Key ID and Access Key Secret with permissions to access the destination resources and write logs.
Limitations
- Configurations are project-level resources and can be referenced only within their project. Multiple resources can reference the same configuration. Changing a configuration's access credentials affects all resources that reference it.
- Events supports Alibaba Cloud SLS configurations. For SQL audit, Alibaba Cloud instances can reference only SLS configurations that belong to the instance's project, match its region, and pass validation.
- After you create a configuration, you cannot change its service provider, region, Project, or Logstore. To use a different destination, create a new configuration and select it in the feature that uses it.
- You cannot delete a configuration that is being referenced.
SQL audit permissions
To deliver SQL audit logs to Alibaba Cloud SLS, the access credentials in the configuration must have at least the following permissions.
Required permission |
Purpose |
|---|---|
log:PostLogStoreLogs |
Write SQL audit logs to the specified Logstore. |
log:GetLogStore |
Obtain Logstore metadata for connection validation. |
Add a log service configuration
Log in to the OceanBase Cloud console.
In the organization drop-down list in the upper-left corner, click the name of the target organization.
In the project list, click Configure project in the Actions column of the target project.
On the Data delivery destinations tab, select Log service and click Add log service.
Configure the following parameters in the dialog box:
ParameterDescriptionName Enter a name to identify this configuration in features that use it. The name must be 2 to 64 characters long and can contain only Chinese characters, digits, English letters, underscores, and hyphens. Names must be unique within the project. The uniqueness check is case-insensitive. Service provider Select Alibaba Cloud SLS. Region Enter the region where the log service resides. Project Enter the log service Project name, which is distinct from the OceanBase Cloud project name. Logstore Enter the name of the Logstore that receives logs. Note
To avoid log delivery failures, add both OceanBase Cloud egress IP addresses
52.220.115.72and43.217.249.143to the log service's allowlist.Access Key ID Enter the ID of an access key with access to the destination log service. For SQL audit, the credentials must meet the SQL audit permissions requirements. Access Key Secret Enter the secret that corresponds to the Access Key ID. Click Test connection to verify the configuration.
If the test fails, check the error message, update the configuration, and try again.
Click Save to create the configuration.
View log service configurations
Go to Project settings > Data delivery destinations > Log service to view configuration names, regions, service providers, references, statuses, and update times.
- View connection details, such as the Project and Logstore, under More information.
- Hover over the reference count to view the resources and features that reference the configuration.
- If the configuration status is abnormal, hover over the status indicator for the cause, and check the access credentials, permissions, and network connectivity.
The platform periodically validates configurations. A failed check does not automatically remove references, but logs may fail to reach the destination. Resolve any issues promptly.
Modify a log service configuration
In the log service configuration list, click Edit in the Actions column of the target configuration.
Modify the name or access credentials. The Access Key Secret is no longer displayed after you save the configuration. To change the credentials, enter both a new Access Key ID and the complete Access Key Secret.
Note
Changing the credentials affects all resources that reference the configuration. Make sure the new credentials grant the required access and write permissions for the existing Project and Logstore. For SQL audit, the new credentials must also meet the SQL audit permissions requirements. To use a different Project or Logstore, create a new configuration and update the references.
If you changed the credentials, click Test connection and proceed after the test succeeds. You do not need to test the connection again if you changed only the name.
Click Save.
If the configuration is being referenced, review the affected resources in the confirmation dialog box and confirm the change. Changing only the name does not change the log delivery destination. Resources that reference the configuration display the new name.
Delete a log service configuration
In the log service configuration list, check whether the target configuration is being referenced.
You cannot delete a configuration that is being referenced. First, change the destination or remove the reference in each feature that uses it.
Click Delete in the Actions column of the target configuration and confirm the deletion.
Deleting a configuration does not delete the Project, Logstore, or historical logs in the log service. Manage log retention and cleanup in the log service.