Chapter 7. Forward to Azure Monitor


You can forward logs to Azure Monitor by using the Logs Ingestion API.

Forward logs to Azure Monitor using the Logs Ingestion API with Data Collection Rules. This procedure shows how to configure the azureLogsIngestion output type with client secret authentication. For workload identity authentication, see the example at the end of this procedure.

Prerequisites

  • You have an Azure account with permissions to create and manage Azure Monitor resources.
  • You created a Data Collection Rule (DCR) in your Azure Log Analytics workspace.
  • You obtained the following information from your DCR:

    • DCR immutable ID
    • Stream name
    • Data collection endpoint URL
  • You created a {entra-id} service principal with the Monitoring Metrics Publisher role assigned to your DCR.
  • You obtained the following {entra-id} credentials:

    • Tenant ID
    • Client ID
    • Client secret (for client secret authentication)
  • You installed the Red Hat OpenShift Logging Operator.
  • You installed the OpenShift CLI (oc).
  • You have administrator access.

Procedure

  1. Create a secret containing your {entra-id} client secret:

    $ oc create secret generic azure-entra-secret \
      --from-literal=client-secret=<your_client_secret> \
      -n openshift-logging
  2. Create a ClusterLogForwarder custom resource (CR) or edit your existing CR. Replace the following values with your Azure configuration:

    • Replace <data_collection_endpoint> and <region> with your data collection endpoint URL. Find this URL in the Azure portal under your DCR details or run az monitor data-collection endpoint show.
    • Replace the dcrImmutableId value with your DCR immutable ID. Find this ID in the Azure portal under the DCR JSON view or run az monitor data-collection rule show.
    • Replace the streamName value with the stream name you defined in your DCR. The stream name must match exactly, including the Custom- prefix and _CL suffix if your DCR uses them.
    • Replace the tenantId value with your {entra-id} tenant ID.
    • Replace the clientId value with your {entra-id} application (client) ID.
    • The secretName value should match the name of the secret you created in step 1.
    apiVersion: observability.openshift.io/v1
    kind: ClusterLogForwarder
    metadata:
      name: azure-logs-forwarder
      namespace: openshift-logging
    spec:
      serviceAccount:
        name: logcollector
      outputs:
      - name: azure-logs-ingestion
        type: azureLogsIngestion
        url: https://<data_collection_endpoint>.<region>.monitor.azure.com
        azureLogsIngestion:
          dcrImmutableId: "dcr-1234567890abcdef1234567890abcdef"
          streamName: "Custom-MyApplicationLogs_CL"
          authentication:
            type: clientSecret
            clientSecret:
              tenantId: "12345678-1234-1234-1234-123456789012"
              clientId: "87654321-4321-4321-4321-210987654321"
              secret:
                secretName: azure-entra-secret
                key: client-secret
      pipelines:
      - name: application-logs
        inputRefs:
        - application
        outputRefs:
        - azure-logs-ingestion
  3. Apply the CR:

    $ oc apply -f <filename>.yaml

Verification

  1. Check the ClusterLogForwarder status:

    $ oc get clusterlogforwarder instance -n openshift-logging -o jsonpath='{.status.conditions}' | jq

    Look for conditions indicating successful configuration and log delivery.

  2. Verify that logs appear in your Azure Log Analytics workspace:

    1. Log in to the Azure portal.
    2. Navigate to your Log Analytics workspace.
    3. Run a query against your custom log table to verify that logs are being ingested:

      MyApplicationLogs_CL
      | take 10

Using workload identity authentication

If your environment supports {entra-id} Workload Identity, you can configure authentication without storing credentials in cluster secrets. Replace the values with your Azure configuration as described in the main procedure.

apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
  name: azure-logs-forwarder
  namespace: openshift-logging
spec:
  serviceAccount:
    name: logcollector
  outputs:
  - name: azure-logs-ingestion
    type: azureLogsIngestion
    url: https://<data_collection_endpoint>.<region>.monitor.azure.com
    azureLogsIngestion:
      dcrImmutableId: "dcr-1234567890abcdef1234567890abcdef"
      streamName: "Custom-MyApplicationLogs_CL"
      authentication:
        type: workloadIdentity
        workloadIdentity:
          tenantId: "12345678-1234-1234-1234-123456789012"
          clientId: "87654321-4321-4321-4321-210987654321"
  pipelines:
  - name: application-logs
    inputRefs:
    - application
    outputRefs:
    - azure-logs-ingestion

Workload identity authentication requires additional {entra-id} configuration, including a federated identity credential that trusts your Red Hat OpenShift Logging cluster’s OIDC issuer.

Configuring custom timestamp field

Some Azure Monitor schemas use different timestamp field names. For example, ASIM (Azure Sentinel Information Model) schemas use EventStartTime instead of the default TimeGenerated. Replace the values with your Azure configuration as described in the main procedure. The timestampField specifies the destination field for the timestamp in your DCR table schema. Common values are TimeGenerated (default), Timestamp (previous versions), or EventStartTime (ASIM).

apiVersion: observability.openshift.io/v1
kind: ClusterLogForwarder
metadata:
  name: azure-logs-forwarder
  namespace: openshift-logging
spec:
  serviceAccount:
    name: logcollector
  outputs:
  - name: azure-logs-ingestion
    type: azureLogsIngestion
    url: https://<data_collection_endpoint>.<region>.monitor.azure.com
    azureLogsIngestion:
      dcrImmutableId: "dcr-1234567890abcdef1234567890abcdef"
      streamName: "Custom-AsimStream_CL"
      timestampField: "EventStartTime"
      authentication:
        type: clientSecret
        clientSecret:
          tenantId: "12345678-1234-1234-1234-123456789012"
          clientId: "87654321-4321-4321-4321-210987654321"
          secret:
            secretName: azure-entra-secret
            key: client-secret
  pipelines:
  - name: application-logs
    inputRefs:
    - application
    outputRefs:
    - azure-logs-ingestion

7.2. Forward to Azure Monitor Logs

You can forward logs to Azure Monitor Logs. The Vector Azure Monitor Logs sink provides this functionality.

Warning

The azureMonitor output type is deprecated and will be removed in a future release. This output type will become obsolete in September 2026.

Prerequisites

  • You have basic familiarity with Azure services.
  • You have an Azure account configured for Azure Portal or Azure CLI access.
  • You have obtained your Azure Monitor Logs primary or the secondary security key.
  • You have determined which log types to forward.
  • You installed the OpenShift CLI (oc).
  • You have installed Red Hat OpenShift Logging Operator.
  • You have administrator permissions.

Procedure

  1. Create a secret with your shared key:

    apiVersion: v1
    kind: Secret
    metadata:
      name: my-secret
      namespace: openshift-logging
    type: Opaque
    data:
      shared_key: <your_shared_key>
    shared_key
    Must contain a primary or secondary key for the Log Analytics workspace making the request.
  2. Obtain a shared key by running the following command in the Azure CLI:

    Get-AzOperationalInsightsWorkspaceSharedKey -ResourceGroupName "<resource_name>" -Name "<workspace_name>”
  3. Create or edit your ClusterLogForwarder CR using the template matching your log selection.

    Forward all logs

    apiVersion: observability.openshift.io/v1
    kind: ClusterLogForwarder
    metadata:
      name: <log_forwarder_name>
      namespace: openshift-logging
    spec:
      serviceAccount:
        name: <service_account_name>
      outputs:
      - name: azure-monitor
        type: azureMonitor
        azureMonitor:
          customerId: my-customer-id
          logType: my_log_type
          authentication:
            sharedKey:
              secretName: my-secret
              key: shared_key
      pipelines:
        - name: app-pipeline
          inputRefs:
          - application
          outputRefs:
          - azure-monitor

    serviceAccount.name
    The name of your service account.
    customerId
    Unique identifier for the Log Analytics workspace. Required field.
    logType
    Record type of the submitted data. Can only contain letters, numbers, and underscores (_), and cannot exceed 100 characters. For more information, see Azure record type in the Microsoft Azure documentation.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top