All Products
Search
Document Center

Simple Log Service:Enable the data collection feature

Last Updated:Aug 18, 2023

CloudLens for CLB allows you to enable the data collection feature with a few clicks to collect Classic Load Balancer (CLB) access logs, Cloud Config logs, and CloudMonitor events. This topic describes how to enable the data collection feature for CLB instances. This topic also describes the operations that you can perform after you enable the feature.

Prerequisites

Authorization

Important

The first time you enable the data collection feature, you must grant the required permissions. If the required permissions are already granted, you can skip this operation.

  1. Log on to the Log Service console.
  2. On the Cloud Service Lens tab in the Log Application section, click CloudLens for CLB.

  3. Follow the on-screen instructions to enable CloudLens for CLB.

    When you enable the application, Simple Log Service automatically authorizes CloudLens for CLB to assume the AliyunServiceRolePolicyForSLSAudit service-linked role to collect CLB logs. For more information, see Manage the AliyunServiceRoleForSLSAudit service-linked role.

Enable data collection

CloudLens for CLB allows you to collect CLB access logs, Cloud Config logs, and CloudMonitor events. The operations that are performed to collect CLB access logs are similar to the operations that are performed to collect Cloud Config logs and CloudMonitor events. In this example, enable data collection for CLB access logs.

  1. Log on to the Log Service console.
  2. On the Cloud Service Lens tab in the Log Application section, click CloudLens for CLB.

  3. On the CLB Instance Access tab of the Access Management page, find the CLB instance for which you want to enable data collection and click Enable.

  4. In the Enable Access Logs Collect dialog box, select the project and the Logstore. Then, click Confirm.

    Important
    • To manage the logs in an efficient manner, we recommend that you store the collected logs in the recommended project and Logstore.

    • The first time you enable data collection for Cloud Config logs, the Cloud Config Logs dialog box appears. Click Authorize Now to grant Simple Log Service the permissions to collect logs from Cloud Config.

What to do next

After you enable CloudLens for CLB, you can perform the following operations on the Access Management page.

Operation

Description

Manage CLB instances

After you enable CloudLens for CLB, CloudLens for CLB displays all CLB instances within the current Alibaba Cloud account.

Click the CLB instance that you want to manage. Then, you are navigated to the SLB console. You can view the details about the CLB instance and create a listener for the instance. For more information, see CLB overview.

Disable data collection

  • Find the CLB instance for which you want to disable data collection and click Disable in the Access Logs column.

  • Click Disable in the Actions column of Cloud Config Logs to disable data collection for Cloud Config logs.

  • Click Disable in the Actions column of CloudMonitor Events to disable data collection for CloudMonitor events.

Query and analyze access logs

Find the CLB instance whose access logs you want to query and analyze and click Access Logs in the Actions column. Then, you are navigated to the Logstore in which the access logs are stored. You can view, query, and analyze the access logs. For more information, see Query and analyze logs.

Modify the data retention period

On the Destination Logstore tab, find the Logstore whose data retention period you want to modify and click the Modify the data retention period icon.

Use the updated data collection feature

If log shipping is enabled for your CLB instance in the SLB console and you enable data collection in the Simple Log Service console when you use CloudLens for CLB, access logs are automatically collected. However, no anomaly detection or metric extraction is performed. You can click Upgrade. Then, CloudLens for CLB automatically detects anomalies, extracts metrics, and generates assets such as detection results, Metricstores, and inspection jobs.