Enable log collection for cloud products
Log Audit Service centrally collects and audits logs from cloud products across accounts and regions.
Prerequisites
SLS is activated. When you first log on to the SLS console, follow the prompts to activate SLS.
Video tutorial
1. Associate a project
-
Log on to the SLS console.
-
In the Log Application area, click the Auditing and Security tab and then select New Log Audit Service.
-
On the Log Auditing page, click Associate Project. In the Associate Project dialog box, select the Region and Project, then click Confirm Association.
2. Cloud product collection
2.1 Create a rule
-
On the Log Auditing page, click Details for the destination project.
-
The following steps describe how to create a collection rule for OSS access logs.
Note-
Log Audit Service centralizes log storage and queries across regions and accounts. Each rule must specify a central project and data store.
-
Rules without a central configuration, such as built-in CloudLens for SLS rules, do not appear on the Log Auditing > Associated Projects page.
Procedure for creating a collection rule:
-
Click the Rules tab.
-
Click Create Collection Rule.
-
In the dialog box, configure Rule Name (for example,
sample), Cloud Service Name (for example, OSS), Log Type (for example, Access Logs), and Resource Matching Mode (for example, All Resources). -
In the central configuration section, select the central project and the central data store. You can select an existing data store or create one.
-
Click OK.
-
2.2 Query and analysis
-
In the rule list of the associated project, click a rule name, such as `sample`, in the Rule Name column.
-
On the rule details page, view the Provisioning and Query and analysis tabs.
3. Dissociate a project
-
Dissociating a project does not delete the rules that use it as the central destination. To delete these rules, call the Cloud Product Collection Rule API.
-
Delete all associated cloud product collection rules before deleting a project. Otherwise, running rules may automatically re-create the project and its LogStores.
On the Log Auditing page, find the target project, click Dissociate, and then click Confirm Dissociation in the confirmation dialog box.