Chapter 6. Azure Monitor Logs Ingestion API
Understand Azure Monitor Logs Ingestion API requirements, Data Collection Rules, authentication methods, and output format before configuring log forwarding.
6.1. Azure Monitor Logs Ingestion API Copy linkLink copied to clipboard!
The Azure Monitor Logs Ingestion API provides a modern, secure method for forwarding logs to Azure Monitor. This API uses Data Collection Rules (DCR) to define log schemas and routing, replacing the Data Collector API.
Microsoft will disable the Data Collector API on September 14, 2026. If you currently use the azureMonitor output type, you must migrate to azureLogsIngestion before this date to avoid service disruption.
The azureLogsIngestion output type implements this API and offers the following advantages over the deprecated azureMonitor output:
- Enhanced security
- Support for {entra-id} Workload Identity allows pod-based authentication without managing shared secrets. Service principal authentication with client secrets remains available for environments that require it.
- Schema flexibility
-
DCRs allow you to define custom log schemas that match your organization’s requirements. You can specify which field receives the timestamp, supporting standard schemas such as
TimeGeneratedor specialized schemas such as ASIM that useEventStartTime. - Improved reliability
- The Logs Ingestion API provides better error handling and status reporting compared to the Data Collector API.
- Azure integration
- DCRs integrate with Azure’s monitoring and compliance frameworks, providing centralized management of log ingestion rules across your organization.
The deprecated azureMonitor output type uses the Data Collector API. Microsoft will disable this API on September 14, 2026. Existing deployments using azureMonitor should migrate to azureLogsIngestion before this date.
Both output types can coexist during the migration period. You can configure both outputs in the same ClusterLogForwarder custom resource (CR) to validate the new configuration before removing the deprecated output.
6.2. Azure Data Collection Rule requirements Copy linkLink copied to clipboard!
Before you can forward logs to Azure Monitor by using the Logs Ingestion API, you must create a Data Collection Rule (DCR) in your Azure environment. The DCR defines the schema for your logs and controls which Log Analytics workspace receives the data.
6.2.1. Data Collection Rule components Copy linkLink copied to clipboard!
A Data Collection Rule for log ingestion requires the following components:
- Data collection endpoint
-
The HTTPS endpoint that receives log data. Azure provides this endpoint URL when you create or view your DCR. The
ClusterLogForwardercustom resource (CR) requires this endpoint URL. - Stream declaration
-
A custom stream definition that specifies the structure of incoming log data. The stream name typically follows the pattern
Custom-<StreamName>_CL. TheClusterLogForwarderCR requires this stream name. - Transformation rule
- An optional Kusto Query Language (KQL) transformation that processes or enriches log data before storage. If you do not specify a transformation, Azure stores the data directly as received.
- Destination workspace
- The Log Analytics workspace where Azure stores the processed logs. The DCR associates the stream with a specific table in this workspace.
6.2.2. Required information for log forwarding configuration Copy linkLink copied to clipboard!
After creating your DCR in Azure, you need the following information to configure the azureLogsIngestion output:
- DCR immutable ID
-
A unique identifier for the Data Collection Rule that Red Hat OpenShift Logging uses to route log data. You can find this ID in the Azure portal under the DCR JSON view or by using the Azure CLI. The immutable ID format is
dcr-followed by a hexadecimal string. - Stream name
-
The exact name of the custom stream you defined in the DCR, for example,
Custom-MyApplicationLogs_CL. - Data collection endpoint URL
-
The HTTPS URL for the data collection endpoint associated with your DCR. This URL typically uses the pattern
https://<endpoint-name>.<region>.monitor.azure.com.
6.2.3. Authentication and permissions Copy linkLink copied to clipboard!
The {entra-id} service principal or workload identity you configure for authentication must have the Monitoring Metrics Publisher role assigned to the DCR. This role grants permission to send data through the specified Data Collection Rule.
You configure authentication credentials in {entra-id} separately from the DCR creation. The credentials do not need access to the Log Analytics workspace directly. The DCR controls data routing and access.
6.3. Azure Logs Ingestion API authentication methods Copy linkLink copied to clipboard!
The azureLogsIngestion output supports two authentication methods for {entra-id}: service principal credentials with a client secret, or {entra-id} Workload Identity. Your choice depends on your security requirements and Azure environment configuration.
6.3.1. Client secret authentication Copy linkLink copied to clipboard!
Client secret authentication uses a {entra-id} service principal with a client ID and secret. You create a secret in the openshift-logging namespace containing the client secret value, then reference this secret in the ClusterLogForwarder custom resource (CR).
This authentication method works in all Azure environments and does not require additional {entra-id} configuration beyond creating the service principal. However, you must manage and rotate the client secret according to your organization’s security policies.
Use client secret authentication when:
- Your organization’s security policies permit storing credentials in cluster secrets
- You need a straightforward authentication method without additional Azure infrastructure
- You already manage service principal credentials for other Azure integrations
6.3.2. Workload identity authentication Copy linkLink copied to clipboard!
Workload identity authentication uses {entra-id} Workload Identity to obtain tokens automatically from the pod environment. This method does not require storing credentials in cluster secrets. Instead, Red Hat OpenShift Logging uses pod-injected service account tokens to authenticate with {entra-id}.
{entra-id} Workload Identity requires additional configuration in your Azure environment. This includes establishing a federated identity credential that trusts your Red Hat OpenShift Logging cluster’s OIDC issuer. The service account running the log collector must include specific annotations that Azure uses to request tokens.
Use workload identity authentication when:
- Your organization’s security policies prohibit storing cloud credentials in cluster secrets
- Your Azure environment supports {entra-id} Workload Identity
- You prefer Azure to manage credential rotation automatically
- You run Red Hat OpenShift Logging on Azure infrastructure
6.3.3. Authentication permissions Copy linkLink copied to clipboard!
Regardless of which authentication method you choose, the {entra-id} application (client ID) must have the Monitoring Metrics Publisher role assigned to the Data Collection Rule. This role grants permission to send log data through the specified DCR to Azure Monitor.
You configure this role assignment in Azure, not in Red Hat OpenShift Logging. The role assignment applies to the {entra-id} application identified by the client ID, whether you authenticate using a client secret or workload identity.
6.4. Azure Monitor Logs Ingestion output format and field mappings Copy linkLink copied to clipboard!
When you forward logs to Azure Monitor by using the Logs Ingestion API, the log collector transforms OpenShift log records into the schema defined by your Data Collection Rule (DCR). Understanding this transformation helps you configure DCRs and query logs in Azure Monitor.
The Azure Monitor Logs Ingestion API requires logs in a JSON array format that matches the schema defined in your Data Collection Rule. Unlike other output types that accept arbitrary JSON, Azure Monitor requires you to pre-define the schema and field mappings in the DCR.
The log collector sends HTTP POST requests to the Data Collection Endpoint (DCE) with the following structure:
Endpoint URL-
https://{dce-endpoint}/dataCollectionRules/{dcr-immutableId}/streams/{streamName}?api-version=2023-01-01 Request body- A JSON array containing one or more log records, each conforming to the DCR stream schema
Headers-
Authorization bearer token from {entra-id}, and
Content-Type: application/json
The DCR controls the transformation from OpenShift log record fields to Azure Monitor table columns. You define this mapping by using Kusto Query Language (KQL) in the DCR’s transformation section.
| Component | Purpose | Configuration location |
|---|---|---|
| Data Collection Endpoint (DCE) | Receives log data over HTTPS | Azure portal or Azure CLI |
| Data Collection Rule (DCR) | Defines schema and field transformations | Azure portal or Azure CLI |
| Stream name | Identifies the input schema for the DCR |
|
| Custom table | Stores the transformed logs |
Azure Monitor workspace (table name must end with |
{
"kubernetes": {
"namespace_name": "my-app",
"pod_name": "web-1",
"container_name": "nginx"
},
"message": "Error connecting to database",
"level": "error",
"@timestamp": "2024-01-15T10:30:00Z"
}
The log collector transforms this into an Azure Monitor Logs Ingestion API request body:
[
{
"TimeGenerated": "2024-01-15T10:30:00Z",
"Namespace": "my-app",
"PodName": "web-1",
"ContainerName": "nginx",
"LogMessage": "Error connecting to database",
"LogLevel": "error",
"RawLog": "{\"kubernetes\":{\"namespace_name\":\"my-app\",\"pod_name\":\"web-1\",\"container_name\":\"nginx\"},\"message\":\"Error connecting to database\",\"level\":\"error\",\"@timestamp\":\"2024-01-15T10:30:00Z\"}"
}
]
You define the transformation from OpenShift fields to Azure columns by using KQL in the DCR:
source
| extend TimeGenerated = todatetime(['@timestamp'])
| extend Namespace = tostring(kubernetes.namespace_name)
| extend PodName = tostring(kubernetes.pod_name)
| extend ContainerName = tostring(kubernetes.container_name)
| extend LogMessage = tostring(message)
| extend LogLevel = tostring(level)
| project TimeGenerated, Namespace, PodName, ContainerName, LogMessage, LogLevel
The DCR transformation extracts nested fields from the OpenShift log record structure and maps them to flat column names in the Azure Monitor table. The TimeGenerated field is typically required and must be mapped from the log record’s @timestamp field.
The deprecated azureMonitor output type uses the Data Collector API, which Microsoft is retiring on September 14, 2026. Use the azureLogsIngestion output type instead.