mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 19:40:41 +01:00
This is not required for 'call <ruleset>' statements, because they already copy message. As of now, this is relevant when foreach feeds messages to an async-action.
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
$IncludeConfig diag-common.conf
|
|
template(name="garply" type="string" string="garply: %$.garply%\n")
|
|
template(name="grault" type="string" string="grault: %$.grault%\n")
|
|
template(name="prefixed_grault" type="string" string="prefixed_grault: %$.grault%\n")
|
|
template(name="quux" type="string" string="quux: %$.quux%\n")
|
|
|
|
module(load="../plugins/mmjsonparse/.libs/mmjsonparse")
|
|
module(load="../plugins/imptcp/.libs/imptcp")
|
|
input(type="imptcp" port="13514")
|
|
|
|
action(type="mmjsonparse")
|
|
set $.garply = "";
|
|
|
|
ruleset(name="prefixed_writer" queue.type="linkedlist" queue.workerthreads="5") {
|
|
action(type="omfile" file="./rsyslog.out.prefixed.log" template="prefixed_grault" queue.type="linkedlist")
|
|
}
|
|
|
|
foreach ($.quux in $!foo) do {
|
|
action(type="omfile" file="./rsyslog.out.log" template="quux")
|
|
foreach ($.corge in $.quux!bar) do {
|
|
reset $.grault = $.corge;
|
|
action(type="omfile" file="./rsyslog.out.async.log" template="grault" queue.type="linkedlist" action.copyMsg="on")
|
|
call prefixed_writer
|
|
if ($.garply != "") then
|
|
set $.garply = $.garply & ", ";
|
|
reset $.garply = $.garply & $.grault!baz;
|
|
}
|
|
}
|
|
action(type="omfile" file="./rsyslog.out.log" template="garply")
|
|
|