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.
Open the navigation menu and select Analytics & AI. Under Messaging, select Connector Hub.
Choose the Compartment where you want to create the service
connector.
Select Create connector.
On the Create connector page, filter VCN flow log to your log group:
Type a Connector name such as "VCN Flow Log Error Analysis."
Select the Resource compartment where you want to store the new connector.
Under Configure connector, select your source and target services to move log data to the log group:
Source: Logging
Target: Logging Analytics
Under Configure source connection, select your VCN flow log:
Compartment: The compartment containing the VCN flow log data.
Log group: The log group containing the VCN flow log data.
Logs: The log object name for your VCN flow logs.
Under Configure task, filter the log data to
rejected traffic:
Property:
data.action
Operator: =
Value: REJECT
If you are interested in rejected traffic for a particular port or
address, add another filter. For example, select the property
data.destinationPort or
data.destinationAddress.
Under Configure target connection, enter the log
group that you want to send the filtered log data to:
post /20200601/namespaces/<namespaceName>/logAnalyticsLogGroups
Host: loganalytics.us-phoenix-1.oci.oraclecloud.com
<authorization and other headers>
{
"compartmentId": "<compartment_OCID>",
"displayName": "My Log Group"
}