All Products
Search
Document Center

EventBridge:Route events to Log Service

Last Updated:May 09, 2026

Use an event rule to filter and route events to Log Service. This topic describes how to route a custom event to Log Service, covering the prerequisites, procedure, and verification.

Prerequisites

Step 1: Add a custom event source

  1. Log on to the EventBridge console. In the left navigation pane, click Event Buses.
  2. In the top navigation bar, select a region. On the Event Buses page, click the name of the target custom event bus.
  3. In the left navigation pane, click Event Sources, and then click Add Event Source.
  4. In the Add Custom Event Source panel, enter a Name and Description, select Custom Application for Event Provider, and then click OK.

Step 2: Create an event rule

Important The target service and the event rule must be in the same region.
  1. Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.

  2. In the top navigation bar, select a region. On the Event Buses page, click the name of the event bus that you want to manage.

  3. In the left-side navigation pane, click Event Rules. On the page that appears, click Create Rule.

  4. In the Create Rule panel, complete the following steps, and then click Create.
    1. On the Configure Basic Info tab, enter a Name and Description for the event rule, and then click Next.
    2. On the Configure Event Pattern tab, set Event Source Type to Custom Event Source. For Event Source, select the custom event source that you added in Step 1: Add a custom event source. In the Pattern Content code editor, enter an event pattern, and then click Next.

      For more information, see event pattern.

    3. On the Configure Targets tab, set Service Type to Simple Log Service, and then configure the following parameters.
      Note You can add up to five targets for a single event rule.
      • Project: Select the Project that you created in Log Service.
      • Logstore: Select the Logstore that you created in Log Service.
      • Topic: Enter a custom log topic.
      • Content: Specify the log content to route. For more information, see event transformation.
      • Role Configuration: Use this role to grant EventBridge permission to write logs to Log Service. The following is an example permission policy. For more information, see permission policy and examples.
        {
          "Version":"1",
          "Statement":[
            {
              "Effect":"Allow",
              "Action":[
                "log:PostLogStoreLogs"
              ],
              "Resource":[
                "acs:log:*:*:project/<your-project-name>/logstore/<your-logstore-name>"
              ]
            }
          ]
        }

Step 3: Publish an event

  1. Log on to the EventBridge console.

  2. In the left-side navigation pane, click Event Buses.

  3. In the top navigation bar, select a region.

  4. On the Event Buses page, find the target event bus and click Publish Event in the Operations column.

    Note

    The EventBridge console supports publishing events to custom event buses only.

  5. In the Publish Event To Custom Event Bus panel, configure the following settings:

    SettingDescription
    Custom Event SourceSelect an existing custom event source from the drop-down list.
    Event BodyEnter the event content.
  6. Click OK.

Verification

  1. Log on to the Log Service console.
  2. In the Project list, click the target Project.
  3. On the Logstore page, click the target Logstore.
  4. Click Search & Analysis to view the results.
    查询分析