All Products
Search
Document Center

Simple Log Service:Collect OSS access logs to Log Audit Service

Last Updated:Sep 24, 2024

After you enable the real-time log query feature for an Object Storage Service (OSS) bucket, the logs of the bucket are automatically collected to the default Logstore for the bucket. If you need to aggregate the logs of multiple OSS buckets across regions to the same Logstore for further analysis, you can use the new version of Log Audit Service.

Background information

How it works

This topic uses the logs of OSS buckets under the same account as an example. As shown in the following diagram, the logs of OSS buckets are first stored in their respective default Logstores. After a collection rule is configured, Log Audit Service automatically creates a data transformation task to aggregate the logs of the default Logstores into the user's associated project and Logstore.

image

Billing

While Log Audit Service itself is free, activating it incurs charges for log storage and log traffic. For more information, see Billing.

Prerequisites

Procedure

Step 1: Associate a project

  1. Log on to the Simple Log Service console. On the Audit & Security tab of the Log Application section , click Log Audit Service (New Version).

    image

  2. On the Log Audit Service (New Version) page, click Associate Project, configure the project in the dialog box, and then click Confirm.

    image

Step 2: Create a collection rule

  1. On the Log Audit (New Version) page, click the name of the project associated in the previous step.

  2. On the Policies tab, click Create Collection Rule.

  3. On the Create Collection Rule dialog box, configure the collection rule, as shown in the following figure. The recommended name for the new Logstore (Destination Store for Centralized Storage) is central-{productCode}-{dataCode}-{policyName}. For more information about the collection rule parameters, see Usage notes of cloud service log collection.

    Note

    If the Resource Matching Mode parameter is set to Instance Mode , you must enter the bucket name in the Instances field for the first time. Next time when you create a collection rule, you can simply select buckets from the Instances drop-down list.

    image

Step 3: Verify the collection results

  1. On the Policies tab, click the name of the collection rule you just created.

  2. Select Query and Analysis > Access Logs to view the logs. You can use the search syntax to specify query conditions. For the field descriptions of the access logs, see Access logs.

    image

References