# template

Selects the rsyslog template that formats messages sent to Event Hubs.

This parameter applies to omazureeventhubs: Microsoft Azure Event Hubs Output Module.

Name:

  template

Scope:

  input

Type:

  word

Default:

  input=RSYSLOG_FileFormat

Required?:

  no

Introduced:

  v8.2304

## Description

Specifies the template used to format and structure the log messages that will be sent from rsyslog to Microsoft Azure Event Hubs.

The message template can include rsyslog variables, such as the timestamp, hostname, or process name, and it can use rsyslog macros, such as `$rawmsg` or `$json`, to control the formatting of log data.

For a message template sample with valid JSON output see the sample below:

    template(name="generic" type="list" option.jsonf="on") {
        property(outname="timestamp" name="timereported" dateFormat="rfc3339" format="jsonf")
        constant(value='"source": "EventHubMessage", ')  # Note trailing comma and space for JSON concatenation
        property(outname="host" name="hostname" format="jsonf")
        property(outname="severity" name="syslogseverity" caseConversion="upper" format="jsonf" datatype="number")
        property(outname="facility" name="syslogfacility" format="jsonf" datatype="number")
        property(outname="appname" name="syslogtag" format="jsonf")
        property(outname="message" name="msg" format="jsonf" )
        property(outname="etlsource" name="$myhostname" format="jsonf")
    }

## Input usage

    action(type="omazureeventhubs" template="generic" ...)

## See also

See also omazureeventhubs: Microsoft Azure Event Hubs Output Module.

Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2025 Rainer Gerhards and others. Licensed under the Apache License 2.0.