omazuredce batches JSON records and sends them to the Azure Monitor Logs
Ingestion API by using a Data Collection Endpoint (DCE), Data Collection Rule
(DCR), and Microsoft Entra client-credentials authentication.
omazuredce: Azure Monitor Logs Ingestion Output Module¶
Module Name: |
omazuredce |
Author: |
Jan Kängsepp |
Available since: |
v8.2604 |
Purpose¶
This module provides native support for forwarding log data to the Azure Monitor Logs Ingestion API.
Each message rendered by the configured template must be a single JSON object.
omazuredce collects those objects into a JSON array, requests an OAuth
access token from Microsoft Entra ID, and posts the resulting batch to the
configured Azure Data Collection Endpoint.
Notable Features¶
Size-aware batching with a configurable
max_batch_byteslimitTimed flushing for partially filled batches via
flush_timeout_msAutomatic OAuth token acquisition for the
https://monitor.azure.com/.defaultscopeRetry-friendly error handling that cooperates with rsyslog action suspension
Requirements¶
To use omazuredce, you need the following:
libcurlsupport at build timeA valid Azure Data Collection Endpoint URL
A Data Collection Rule ID
A target stream or table name accepted by the DCR
A Microsoft Entra application with
client_id,client_secret, andtenant_idvalues that can request tokens forhttps://monitor.azure.com/.defaultA template that renders one valid JSON object per message, or the built-in
StdJSONFmtdefault
The module is built only when ./configure is invoked with
--enable-omazuredce=yes.
Configuration Parameters¶
Note
Parameter names are case-insensitive; snake_case is used in the examples because the module’s parameter names contain underscores.
Note
This module supports action parameters only.
Action Parameters¶
Parameter |
Summary |
|---|---|
Selects the rsyslog template used to render each message before it is added to the Azure ingestion batch. |
|
Specifies the Microsoft Entra application client ID used for OAuth token requests. |
|
Supplies the client secret paired with |
|
Sets the Microsoft Entra tenant used when requesting OAuth access tokens. |
|
Defines the Azure Data Collection Endpoint base URL used for batch submission. |
|
Specifies the Azure Data Collection Rule immutable ID used in the ingestion URL. |
|
Sets the stream or table name appended to the Azure ingestion request path. |
|
Limits the estimated total size of one Azure ingestion request, including the payload and HTTP overhead. |
|
Controls how long a partially filled batch may stay idle before it is flushed. |
Batching Behavior¶
omazuredce builds one JSON array per worker and flushes it when one of the
following happens:
Adding the next record would exceed
max_batch_bytesThe action queue transaction ends and
flush_timeout_msis set to0The batch has been idle for at least
flush_timeout_msmilliseconds
The internal size check is conservative. It includes both the JSON payload size and an estimate for HTTP headers before sending the request.
Error Handling¶
The module obtains an OAuth access token before sending data. If Azure returns
401 Unauthorized for a batch request, the module refreshes the token and
returns RS_RET_SUSPENDED. The failed batch is then retried by rsyslog’s
central action engine according to the configured action backoff and retry
settings. Other retryable HTTP failures follow the same RS_RET_SUSPENDED
path.
If a rendered message is too large to fit into an empty batch under the current
max_batch_bytes setting, the module logs an error and drops that record.
Example¶
The following example renders each event as one JSON object and forwards it to Azure Monitor Logs Ingestion:
module(load="omazuredce")
template(name="tplAzureDce" type="list" option.jsonf="on") {
property(outname="TimeGenerated" name="timereported" dateFormat="rfc3339" format="jsonf")
property(outname="Host" name="hostname" format="jsonf")
property(outname="AppName" name="app-name" format="jsonf")
property(outname="Message" name="msg" format="jsonf")
}
action(
type="omazuredce"
template="tplAzureDce"
client_id="<application-id>"
client_secret="<client-secret>"
tenant_id="<tenant-id>"
dce_url="https://<dce-name>.<region>.ingest.monitor.azure.com"
dcr_id="<dcr-id>"
table_name="Custom-MyTable_CL"
max_batch_bytes="1048576"
flush_timeout_ms="2000"
)
Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project
Contributing: Source & docs: rsyslog source project
© 2008–2026 Rainer Gerhards and others. Licensed under the Apache License 2.0.