exec_template() — rsyslog 8.2412.0 documentation

# exec_template()

## Purpose

exec_template(str)

Sets a variable through the execution of a template. Basically this permits to easily extract some part of a property and use it later as any other variable.

Read more about it here : http://www.rsyslog.com/how-to-use-set-variable-and-exec_template

## Example

The following example shows the template being used to extract a part of the message.

    template(name="extract" type="string" string="%msg:F:5%")
    set $!xyz = exec_template("extract");

See also

Help with configuring/using `Rsyslog`:

- Mailing list - best route for general questions

- GitHub: rsyslog source project - detailed questions, reporting issues that are believed to be bugs with `Rsyslog`

See also

Contributing to `Rsyslog`:

- Source project: rsyslog project README.

- Documentation: rsyslog-doc project README

Copyright 2008-2023 Rainer Gerhards (Großrinderfeld), and Others.