Scenario: Analyzing Logs

Send log data to Logging Analytics.

This scenario involves creating a log group and a connector. The connector (Connector Hub)  processes and moves log data from Logging to the log group in Logging Analytics.

Required IAM Policy

If you're a member of the Administrators group, you already have the required access to execute this scenario. Otherwise, you need access to Logging Analytics to create the log group and access to Connector Hub to create the connector.

The workflow for creating the connector includes a default policy when needed to provide permission for writing to the target service. If you're new to policies, see Getting Started with Policies and Common Policies.

Setting Up This Scenario

Setup is easy in the Console. Alternatively, you can use the Oracle Cloud Infrastructure CLI or API, which lets you execute the individual operations yourself.

Using the Console

This section walks through creating a log group and a connector using the Console.

For help with troubleshooting, see Troubleshooting Connectors.

Task 1: Create the log group

Use Logging Analytics to create the log group. For instructions, see Create Log Groups.

Using the CLI

This section walks through creating the log group and connector using the CLI.

For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.

  1. Create a log group: Open a command prompt and run the oci log-analytics log-group create command:

    Command
    oci log-analytics log-group create --display-name "<display_name>" --compartment-id <compartment_OCID> --namespace-name "<namespace_name>"
  2. Create a connector: Open a command prompt and run the oci sch service-connector create command:

    Command
    oci sch service-connector create --display-name "<display_name>" --compartment-id <compartment_OCID> --source [<source_in_JSON>] --tasks [<tasks_in_JSON>] --target [<targets_in_JSON>]

For help with troubleshooting, see Troubleshooting Connectors and Troubleshooting Notifications.

Using the API

This section walks through creating the log group and connector using the API.

For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.

Use the following operations:

  1. CreateLogAnalyticsLogGroup: Create a log group.

  2. CreateServiceConnector: Create a connector.

For help with troubleshooting, see Troubleshooting Connectors and Troubleshooting Notifications.