With CloudLens for CLB, you can enable data collection in just a few clicks to collect CLB access logs, Cloud Config logs, and CloudMonitor events. This topic describes how to enable data collection and perform related tasks.
Prerequisites
-
You have created a CLB instance. For more information, see Create an instance.
-
You have configured a Layer 7 listener, such as an HTTP or HTTPS listener, for the CLB instance. For more information, see Add an HTTP listener or Add an HTTPS listener.
-
You have created a project and a Logstore in Simple Log Service. For more information, see Manage projects and Create a basic Logstore.
-
To collect Cloud Config logs, you must first activate Cloud Config. For more information, see Quick start for Cloud Config.
-
To collect CloudMonitor events, you must first activate EventBridge. For more information, see Step 1: Activate EventBridge.
Configure permissions
You only need to configure permissions the first time. If you have already done so, skip these steps.
- Log on to the Log Service console.
-
In the Log Application section, on the Cloud Service Lens tab, click CloudLens for CLB.
-
Follow the on-screen instructions to enable CloudLens for CLB.
During this process, the system automatically grants CloudLens for CLB the
AliyunServiceRoleForSLSAuditservice-linked role to collect CLB logs. For more information, see Manage the AliyunServiceRoleForSLSAudit service-linked role.
Enable data collection
CloudLens for CLB collects CLB 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.
- Log on to the Log Service console.
-
In the Log Application section, on the Cloud Service Lens tab, click CloudLens for CLB.
-
On the Access Management page, on the CLB Instance Access tab, find the target CLB instance and click Enable.
-
In the Enable Access Logs Collect dialog box, select the destination project and Logstore, and then click Confirm.
Important-
We recommend storing logs in the recommended project and Logstore for easier management of your Simple Log Service assets.
-
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 permission to collect your Cloud Config logs.
-
Related tasks
After enabling CloudLens for CLB, you can also perform the following tasks on the Access Management page.
|
Actions |
Description |
|
Manage CLB instances |
After you enable CloudLens for CLB, CloudLens for CLB displays all CLB instances in the current Alibaba Cloud account. Click a target CLB instance. You are redirected to the Server Load Balancer (SLB) console. You can view the details of the CLB instance and perform tasks, such as creating a listener. For more information, see CLB instances. |
|
Disable data collection |
|
|
Query and analyze logs |
Click Access Logs for a target CLB instance to open the corresponding Logstore. In the Logstore, you can view the raw logs and perform queries and analyses. For more information, see Quick start for log query and analysis. |
|
Modify the data retention period |
On the Destination Logstore tab, find the target Logstore, click the |
|
Upgrade legacy access log collection |
If log shipping is enabled for your CLB instance in the SLB console and you then enable data collection in CloudLens for CLB, only access logs are collected by default. Operations such as anomaly detection and metrics collection are not performed. You can click Upgrade. CloudLens for CLB then automatically performs anomaly detection, extracts metrics, and generates assets such as inspection results, a MetricStore, and inspection jobs. |
icon, and then change the data retention period.