Format

Format

This filter is used to format the received Message. It is based on the Golang templates and it can load templates from the template_path directory specified in the configuration file.

Parameters

ParameterTypeDefaultDescription
typeSTRING“text”specify the type of template to use : "text" or "html"
templateSTRINGemptya template could be specified directly here, instead of load it from file
fileSTRINGemptyload the template from file

In the template is allowed to use all the fields of the received Message: main or extra.

... | format(type="html", template="main : {{.main}} extra : {{.file_name}}") | ...

Output

The new formatted text is sent to the next filter in the main field of the Message. The extra fields do not undergo changes.

Examples