IBM Cloud Docs
Configuring an outbound integration to connect IBM Cloud Logs with IBM Cloud Event Notifications

Configuring an outbound integration to connect IBM Cloud Logs with IBM Cloud Event Notifications

To send events that are generated when an alert is triggered in an IBM Cloud Logs instance, you must connect your IBM Cloud Logs instance to Event Notifications by configuring an outbound integration.

Prereqs

Step 1. Define a service to service authorization

A service to service authorization is used in the IBM Cloud account to authorize the IBM Cloud Logs service to send events to the Event Notifications service.

You must configure a service to service authorization between the IBM Cloud Logs instance and the Event Notifications instance. For more information, see Creating a S2S authorization to work with the IBM Cloud Event Notifications service.

Step 2. Configuring an outbound integration by using the API

You can create an outbound integration by using the API. For more information about the API method, see Create an outbound integration.

You can only configure via API the integration between an IBM Cloud Logs instance and an Event Notifications instance that are located in different accounts.

For example, you can use the following cURL command to create an integration via API:

curl -X POST "https://API-ENDPOINT/v1/outgoing_webhooks" \
 -H "Authorization: ${IAM_TOKEN}" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 -d '{
  "type": "ibm_event_notifications",
  "name": "<NAME>",
  "ibm_event_notifications": {
   "event_notifications_instance_id": "<EventNotificationsInstanceID>",
   "region_id": "<Region-of-EventNotifications-Instance>",
   "endpoint_type": "default_or_public"
  }
 }'

Where

  • API-ENDPOINT: Set the API endpoint for the IBM Cloud Logs instance.

  • type: Defines the type of integration. Set to ibm_event_notifications.

  • name: Enter a name for this resource definition.

  • IAM_TOKEN: Enter the IAM_TOKEN. You can run the following command to get the IAM token:

    export IAM_TOKEN=`ibmcloud iam oauth-tokens --output json | jq -r '.iam_token'`
    
  • event_notifications_instance_id: Set to the Event Notifications instance ID.

  • region_id: Set to the region where the Event Notifications instance is available.

  • endpoint_type: Define whether the integration goes through the public or the private network. Valid values are: default_or_public,or private

Step 2. Configuring an outbound integration in the UI

Complete the following steps to configure an outbound integration:

  1. In the console, click the Navigation Menu icon Navigation Menu icon > Resource list.
  2. Select your instance of IBM Cloud Logs.
  3. In the IBM Cloud Logs navigation, click the Integrations icon Integrations icon > Outbound integrations.
  4. In the outbound integrations section, find Event Notifications and click Add.
  5. On the Integrations page, click Add new.
  6. If an IAM authorization between IBM Cloud Logs and Event Notifications doesn't exist in your account, you must configure one by clicking IAM Authorizations. Follow the prompts to grant access between the services. For more information, see Creating a S2S authorization to work with the IBM Cloud Event Notifications service.
  7. Enter a name for the integration.
  8. Select the Event Notifications service instance that you want to connect to your IBM Cloud Logs instance.
  9. Select the Endpoint Type as public or private. For more information, see Service endpoints for Event Notifications
  10. To confirm the connection, click Save.

An IBM Cloud Event Notifications source is created with the following name:

IBM Cloud Logs - <CLOUD_LOGS_INSTANCE_ID>

For example, the source name in IBM Cloud Event Notifications looks as follows:

IBM Cloud Logs - rfdt3147-484f-4dee-b3c7-ab0c85a8e5c7

The name of the outbound integration is not used to name the source in the IBM Cloud Event Notifications instance.

Test your connection

After you enable notifications for IBM Cloud Logs, test your connection to ensure that the events that are generated by IBM Cloud Logs are being forwarded to Event Notifications.

First, complete the following steps in the Event Notifications instance:

  1. Verify the source with name IBM Cloud Logs - <CLOUD_LOGS_INSTANCE_ID>, that matches your integration name, is created in the IBM Cloud Event Notifications instance.

    1. Select Sources.
    2. Look for the source with name IBM Cloud Logs - <CLOUD_LOGS_INSTANCE_ID>.
  2. Create a topic that specifies this Cloud Logs instance as the source and "Event type" scoped to "Test Event".

    1. Select Topics. Then, click Create.
    2. Enter a topic name, for example, CloudLogsInstance-test.
    3. Select the source IBM Cloud Logs - <CLOUD_LOGS_INSTANCE_ID> for the instance whose integration you want to test.
    4. Select the Event type Test Event.
    5. Select Add a condition > Save source.
    6. Click Create.
  3. Create a destination and verify the destination is configured. For example, you can configure a Slack destination or an email.

  4. Create a Subscription pairing the topic and the destination.

    1. Enter a name, for example, Test integration.
    2. Select the topic CloudLogsInstance-test.
    3. Select a destination.
    4. Click Create.

Next, in the IBM Cloud Logs UI, complete the following steps:

  1. Edit the outbound integration.
  2. Click Test.
  3. Check your chosen destination and verify the test event has been sent.