DEV Community

Sindhuja N.S
Sindhuja N.S

Posted on

📘 Configure Log Forwarding to Azure Monitor in OpenShift – No Coding Needed

When you’re running apps in production on OpenShift, logs are your best friend. They help you understand what’s working, what’s failing, and how to fix issues fast. But going through logs manually on each pod or node? That’s a nightmare.

That’s where log forwarding to Azure Monitor comes in. With just a few configuration steps (no scripting or coding needed), you can send all your OpenShift logs directly to Azure Monitor, where they’re easier to manage, search, and store long-term.

🧠 What Is Log Forwarding?
Log forwarding means automatically sending logs (from your applications and the cluster itself) to a centralized system. In this case, we’re sending OpenShift logs to Azure Monitor, Microsoft’s monitoring platform.

💡 Why Use Azure Monitor?
One dashboard for everything – apps, infra, and network

Smart alerting when something goes wrong

Better visibility for developers and ops teams

Long-term storage without cluttering your OpenShift cluster

Integrates well with tools like Power BI, Logic Apps, and Azure Sentinel

🔧 What You Need Before You Start
Here’s what to make sure is ready:

✅ OpenShift Cluster (version 4.x)
✅ Cluster Logging Operator installed (can be done from OperatorHub)
✅ Azure Log Analytics Workspace (in Azure Monitor)
✅ Access to the Azure Portal (to get workspace ID and key)
✅ OpenShift Web Console access (with admin privileges)

🪜 Steps to Set It Up (No Coding)
1️⃣ Install the Cluster Logging Operator
Log into your OpenShift Web Console

Go to Operators → OperatorHub

Search for "Cluster Logging"

Click Install, then follow the prompts

It will install everything needed for log collection

2️⃣ Get Your Azure Monitor Details
In your Azure Portal:

Go to Azure Monitor → Logs

Click on your Log Analytics Workspace

Note down the Workspace ID and Primary Key (you’ll need both)

3️⃣ Create a Secret (Via Web Console)
Go to Workloads → Secrets in openshift-logging project

Click Create → Key/Value Secret

Name it: azure-monitor-secret

Add two keys:

customer_id → your Workspace ID

shared_key → your Primary Key

Click Create

4️⃣ Set Up Log Forwarding
Go to Administration → Custom Resource Definitions (CRDs)

Search for: ClusterLogForwarder

Click Create instance

Use the form to define:

Output name: azure-monitor

Type: azure-monitor

Reference the secret you just created

Choose which logs to forward (application, infrastructure, audit)

There’s no code here – it’s a guided form in the console.

5️⃣ Check That Logs Are Reaching Azure
After a few minutes:

Go back to your Azure Monitor

Click on Logs under your workspace

Use the search bar to explore logs using queries like:

nginx
OpenShiftLogs_CL

🔄 Ongoing Benefits
Once set up:

You don’t have to touch it again

Logs will flow automatically

You’ll have full visibility across all your apps and infrastructure

✅ Summary
You just connected OpenShift to Azure Monitor – without writing a single line of code.

📦 All your app and cluster logs are now centralized
📊 You can set up dashboards, alerts, and reports in Azure
💼 Great for compliance, audits, and performance tracking

For more info, Kindly follow: Hawkstack Technologies

Top comments (0)