template¶
Selects the message template that renders the INSERT statement sent to ClickHouse.
This parameter applies to omclickhouse: ClickHouse Output Module.
- Name:
template
- Scope:
input
- Type:
word
- Default:
`` StdClickHouseFmt``
- Required?:
no
- Introduced:
not specified
Description¶
This is the message format that will be sent to ClickHouse. The resulting
string needs to be a valid INSERT Query, otherwise ClickHouse will return an
error. Custom INSERT templates must enable the template-level SQL escaping
option, for example option.stdsql="on" in RainerScript. stdSQL is not
an omclickhouse action parameter. Defaults to:
Note
The leading space in `` StdClickHouseFmt`` is intentional. Rsyslog
registers its built-in templates with a leading space in the internal
configuration state, and the module looks up the default by that exact
name. When overriding the parameter yourself, use the natural form
StdClickHouseFmt (without the space) as shown below.
"\"INSERT INTO rsyslog.SystemEvents (severity, facility, "
"timestamp, hostname, tag, message) VALUES ("
"%syslogseverity%, %syslogfacility%, "
"'%timereported:::date-unixtimestamp%', '%hostname%', "
"'%syslogtag%', '%msg%')\""
Input usage¶
module(load="omclickhouse")
template(name="CustomClickHouseFmt" type="string" option.stdsql="on"
string="INSERT INTO rsyslog.SystemEvents (severity, facility, timestamp, hostname, tag, message) VALUES (%syslogseverity%, %syslogfacility%, '%timereported:::date-unixtimestamp%', '%hostname%', '%syslogtag%', '%msg%')")
action(type="omclickhouse" template="CustomClickHouseFmt")
See also¶
See also omclickhouse: ClickHouse Output Module.
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.