All Products
Search
Document Center

Simple Log Service:Enable the real-time log query feature

Last Updated:Aug 08, 2023

Before you can query and analyze Object Storage Service (OSS) access logs, you must enable the real-time log query feature in the OSS console. This topic describes how to enable the real-time log query feature in the OSS console.

Prerequisites

  • An OSS bucket is created. For more information, see Create buckets.

    The Simple Log Service project that is used to store OSS access logs and the OSS bucket must belong to the same Alibaba Cloud account and reside in the same region.

  • Simple Log Service is authorized to assume the AliyunLogImportOSSRole role to access OSS.

    You can go to the Cloud Resource Access Authorization page and follow the on-screen instructions to complete the authorization. The first time you enable the real-time log query feature, you must complete the authorization by using your Alibaba Cloud account.

    Warning

    Do not revoke permissions from the Resource Access Management (RAM) role or delete the RAM role. Otherwise, OSS logs cannot be sent to Simple Log Service.

Procedure

Important

Before you can use a RAM user to enable the real-time log query feature, you must grant the required permissions to the RAM user. For more information, see RAM user authorization.

Enable the real-time log query feature when you create a bucket

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the page that appears, click Create Bucket.

  3. In the Create Bucket panel, turn on Real-time Log Query.

    For more information about other parameters, see Create buckets.

  4. Click OK.

Enable the real-time log query feature for an existing bucket

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the Buckets page, find and click the desired bucket.

  3. In the left-side navigation tree, choose Logging > Real-time Log Query.

  4. Click Activate Now.

What to do next

If you no longer require the real-time log query feature, perform the following steps to disable the feature:

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the Buckets page, find and click the desired bucket.

  3. In the left-side navigation pane, choose Real-time Log Query.

  4. In the upper-right corner, click Disable Real-time Log Query.

    Important

    After you disable the real-time log query feature, the dedicated project that is automatically created when you enable the feature and the OSS access logs in the project are not automatically deleted. To prevent unwanted fees after you disable the feature, we recommend that you manually delete the project in the Simple Log Service console. For more information, see Delete a project.

Related operations

After Simple Log Service collects OSS access logs, you can query, analyze, download, ship, and transform the logs in the Simple Log Service console. You can also configure alerts for the logs. For more information, see Common operations on logs of Alibaba Cloud services.