Dashboard for OIC Logs

Santhosh Kumar BVSRK
4 min readJun 8, 2022

In continuation to my previous blog, where we have learnt how to enable Activity Stream Logs for OIC.

In this blog, we will focus on Generating Dashboards from OIC Logs.

Pre-Requisites

  1. You have enabled Logging Analytics in your tenancy/compartment.
  2. You have enabled Activity Stream logs on your OIC Instance.

IAM Policies for Logging Analytics

OCI works on a Zero Trust Security policy i.e., by default you won’t have access to any resource. You need write IAM Policies at Root/Compartment level based on your requirement to gain access.

In that context to use Log Explorer to see your logs or to make that log search available on your Logging Analytics Dashboard you need to have couple of policies both at Root/Tenancy & Compartment Level. Mentioned below are few basic Policies:

Root/Tenancy Level IAM Policies

allow service loganalytics to {LOG_ANALYTICS_LIFECYCLE_INSPECT, LOG_ANALYTICS_LIFECYCLE_READ} in tenancy.

allow service loganalytics to read loganalytics-features-family in tenancy.

allow any-user to manage loganalytics-features-family in tenancy.

Compartment Level IAM Policies

allow group <IAMUserGroupName> to read metrics in compartment <CompartmentName>.

allow group <IAMUserGroupName> to read management-dashboard in compartment <CompartmentName>

allow group <IAMUserGroupName> to MANAGE management-dashboard-family in compartment <CompartmentName>

allow group <IAMUserGroupName> to MANAGE loganalytics-resources-family in compartment <CompartmentName>

Generating Dashboards from OIC Logs

OCI (Oracle Cloud Infrastructure) Logging service provides customers with the flexibility to create Service Connector using which we can push Logs from a specific Log Group — Log File to defined targets like Functions, Logging Analytics, Object Storage, Monitoring, Notifications & Streaming services of OCI.

Left Hamburger Menu → Observability & Management → Logging → Service Connector

OCI Service Connector

For our scenario i.e., to generate Dashboard we need to feed Log data to Logging Analytics. So, we will be creating a connector for the same.

Creating Service Connector to push Logs to Logging Analytics
  1. Source → Logging in our case
  2. Target → Logging Analytics in our case
  3. Source Connection → From which Log Group and Log file we want to fetch logs.
  4. Target Connection → Compartment and Log Group of Logging Analytics.

This makes the Activity Stream logs of OIC available in OCI Logging analytics Log Group “OIC_LogGroup”.

Now, let us build a dashboard in Logging Analytics.

Left Hamburger Menu → Observability & Management → Logging Analytics

Under Administration on the left side, you will have the option to create Log Group for Logging Analytics, which we will be choosing as target while creating Service Connector.

For OIC, we can generate 2 types of Dashboards:

a. Dashboard for OIC Activity Stream Logs.

b. Dashboard for OIC Metrics i.e., metrics which you can see on OCI console OIC Instance.

Dashboard for Activity Stream Logs

For creating Dashboards, click on “Create Dashboard” under Dashboards on the left side under Logging Analytics.

Chose a name for your Dashboard, chose the Compartment and save it.

Now, under Logging Analytics go to Log Explorer search for your Log Source, this will give all the activity stream data from OCI Activity Stream logs.

You can add filters as per your requirement and chose a chart of your choice to represent data as below

Log Explorer

Once you are fine with this to be on your dashboard, Under Actions on right top, click on Save. Give a Name to your search with description and enable the checkbox to add it to the dashboard and chose the previously created dashboard.

Saving your Log Search Query and attaching result to Dashboard

This is how the dashboard looks like after adding the earlier query as a widget.

Logging Analytics Dashboard

Now, you can read the log data easily, by changing your filters in log explorer. You can click on this graph, which will take you back to Log Explorer where you can change the filters, group by, date range, etc., to generate a new set of dashboard.

In this example, I have changed the Group by to Identifier (which holds my Integration Name), changed the date to show last 7 days data as below, which I will be adding as another widget to the dashboard.

Updated Search Criteria
Updated Dashboard

I can further drill down on this data by clicking on the graph, which will take me back to Log Explorer, there again I can drill down to see data specific to an integration for a particular data and time by clicking on the graph or a particular error by selecting it or by adding it to the filters.

In this way, you can create basic Dashboards for your OIC Activity Stream Logs as per your requirement.

Dashboard for OIC Metrics

Creating Dashboard for OIC Metrics is explained here.

How to enable Activity Stream Logs on your OIC Instance is explained here.

--

--

Santhosh Kumar BVSRK

16+ Years in IT/ITES| ML & AI Enthusiast| Oracle Cloud Architect, Integration Specialist — BPEL, OSB, OIC, IICS| Database Scripting-SQL, PL/SQL, MySQL