Enable data collection

更新时间:
复制 MD 格式

CloudLens for CLB enables one-click collection of CLB access logs, Cloud Config logs, and CloudMonitor events.

Prerequisites

Grant permissions

Important

This is a one-time authorization. Skip this section if already completed.

  1. Log on to the Simple Log Service console.

  2. In the Log Application section, on the Cloud Service Lens tab, click CloudLens for CLB.

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

    Enabling this feature automatically authorizes CloudLens for CLB to use the AliyunServiceRoleForSLSAudit service-linked role for log collection. Manage the AliyunServiceRoleForSLSAudit service-linked role.

Enable data collection

CloudLens for CLB collects access logs, Cloud Config logs, and CloudMonitor events. The procedure is similar for all data types. The following steps use access log collection as an example.

  1. Log on to the Simple Log Service console.

  2. In the Log Application section, on the Cloud Service Lens tab, click CloudLens for CLB.

  3. On the CLB Instance Access tab of the Data Import Management page, find the target CLB instance and click Enable.

  4. In the Enable Access Log Collection dialog box, select the destination project and Logstore, and then click Confirm.

    Important
    • Using the suggested project and Logstore simplifies asset management.

    • When enabling Cloud Config log collection for the first time, click Authorize Now in the Cloud Config Logs dialog box to grant Simple Log Service access to Cloud Config logs.

Related operations

After enabling CloudLens for CLB, you can perform the following operations on the Data Import Management page.

Actions

Description

Manage CLB instances

After you enable CloudLens for CLB, CloudLens for CLB displays all CLB instances in your Alibaba Cloud account.

Click a CLB instance to open the CLB console, where you can view details and manage listeners. CLB instances.

Disable data collection

  • To disable access log collection for a specific CLB instance, find the instance and click Disable in the Access Logs column.

  • On the Global Logs tab, click Disable next to Cloud Config Logs to disable Cloud Config log collection.

  • On the Global Logs tab, click Disable next to CloudMonitor Events to disable CloudMonitor event collection.

Query and analyze logs

Click Access Logs for a CLB instance to open its Logstore, where you can query and analyze logs. Quick guide to query and analysis.

Modify the retention period

On the Destination Logstores tab, find the target Logstore and click the Modify retention period icon to change its data retention period.

Upgrade legacy access logs

If log shipping is already enabled for a CLB instance on the CLB console, access logs are collected by default when you enable data collection in CloudLens for CLB. However, this basic collection does not include anomaly detection or metric extraction. Click Upgrade to enable these features. CloudLens for CLB then automatically performs anomaly detection, extracts metrics, and generates assets such as inspection results, a Metricstore, and inspection jobs.