All Products
Search
Document Center

Cloud Config:Deliver resource data to a Logstore in Simple Log Service

Last Updated:Jan 22, 2024

You can deliver resource change logs, resource non-compliance events, and scheduled resource snapshots to a Logstore in a project in Simple Log Service. After resource data is delivered to the specified Logstore as logs, you can query and analyze the delivered logs.

Prerequisites

  • Simple Log Service is activated. For more information, see Activate Simple Log Service.

    Important

    You are not charged when you activate Simple Log Service. Cloud Config delivers resource data to Simple Log Service, and you are charged if you use the query and analysis features of Simple Log Service. For more information, see Billing overview.

  • If you want to deliver large files to an Object Storage Service (OSS) bucket, you must activate OSS and create the OSS bucket. For more information, see Get started by using the OSS console.

    Note

    You must make sure that the settings of the Region, Account, and Bucket Name parameters in the Recipient Address For Large Files section are the same as those of the recipient address for common files.

Background information

If you do not want to incur fees for Simple Log Service, you can delete the Simple Log Service project in the Simple Log Service console. After you delete the Simple Log Service project, the delivery task in Cloud Config becomes invalid and the resource data is no longer delivered. For more information, see Delete a project.

Procedure

  1. Log on to the Cloud Config console.

  2. Optional. In the upper-left corner, select an account group.

    This operation is required only if you are using a management account of a resource directory. Otherwise, you do not need to perform the operation.

  3. In the left-side navigation pane, click Deliveries.

  4. On the Deliveries page, click Create Delivery in the upper-left corner.

  5. On the Create Delivery page, set the Delivery Name parameter, select Log Service from the Channel Type drop-down list, and then set the parameters of Simple Log Service.

    The following table describes the parameters for resource data delivery.

    Parameter

    Description

    Content

    The type of the resource data that you want to deliver to Simple Log Service. Valid values:

    • Historical Configuration Changes: resource change logs. When the configuration of a resource changes, Cloud Config delivers the resource change log to Simple Log Service.

    • Noncompliance Resource Events: resource non-compliance events. If a resource is evaluated as non-compliant, Cloud Config delivers the resource non-compliance event to Simple Log Service.

    • Scheduled Snapshots: scheduled resource snapshots. Cloud Config delivers resource snapshots to Simple Log Service at 00:00:00 and 12:00:00 every day.

      Note

      If you specify Daily Delivery Time, Cloud Config delivers resource data based on the specified time.

    Logstore Source

    The source of the Logstore. Valid values:

    • Create a new log item in this account: In the Cloud Config console, select a region, and create a project and a Logstore in the region. The project name and Logstore name must be unique in an Alibaba Cloud account in the same region.

      Note

      The Logstore created by using Cloud Config does not contain any preset indexes. If you need to analyze delivery data, you must enable the indexing feature for the Logstore in the Simple Log Service console. For more information, see Create indexes.

    • Select an existing log item in this account: Select a region, a project, and a Logstore in Simple Log Service.

      Note

      Make sure that the Logstore you selected is empty or the existing data in the Logstore is consistent with the data that you want to deliver. Otherwise, the data cannot be queried or analyzed after it is delivered to the Logstore.

    • Select an existing topic from other enterprise management accounts or delegated accounts: Specify the Alibaba Cloud Resource Name (ARN) of the Logstore in the destination account. The ARN contains the following information: region, member account, project name, and Logstore name.

      You can deliver the resource data of your account and all member accounts in the resource directory to the Logstores of specific member accounts. You can use only management accounts to configure the delivery settings of resource data. Member accounts do not have the permissions to configure the settings.

      Note

      If a delegated administrator account is configured by using a management account, the administrator account can be used to configure resource data delivery. For more information, see Add a delegated administrator account.

    Events Of Specified Resource Type

    The resource type of the data that you want to deliver. For more information about the resource types supported by Cloud Config, see Alibaba Cloud services and resource types supported by Cloud Config.

    Daily Delivery Time

    The time when Cloud Config delivers scheduled resource snapshots every day.

    Note

    If you do not specify this parameter, Cloud Config delivers resource snapshots to the OSS bucket at 00:00:00 and 12:00:00 every day.

    Recipient Address For Large Files

    The OSS bucket that is used to receive the large files that Cloud Config delivers to the Logstore in Simple Log Service.

    • If you set this parameter, a file that Cloud Config delivers to the Logstore is automatically transferred to the specified OSS bucket when the file size exceeds 1 MB.

    • If you leave this parameter empty, the excess part of a file that Cloud Config delivers to the Logstore is automatically discarded when the file size exceeds 1 MB.

  6. Click OK.

  7. (Optional) In the Confirm Operation dialog box, click OK.

    This operation is required only if you are using a management account of a resource directory. Otherwise, you do not need to perform the operation.

    Note

    The newly created delivery task takes effect only on all member accounts in the account group.

What to do next

View the delivery result of resource data, and query and analyze logs in the Logstore.

  1. On the Deliveries page, click the newly created delivery ID.

  2. In the Extended Information section of the page that appears, click the name of the Logstore.

    You are redirected to the destination Logstore page in the Simple Log Service console.

  3. In the Error message, click Close.

    Note

    The indexing feature is not enabled for a Logstore created in the Cloud Config console by default, and the system reports an error.

  4. Enable the indexing feature for the Logstore.

    For more information, see Create indexes.

  5. Query and analyze logs in the Logstore.

    For more information, see Query and analyze logs.

    Note

    For more information about the sample files in the JSON format, see Examples of resource change logs, Example of resource non-compliance events, and Example of scheduled resource snapshots.