Linux 模板名称中的Rsyslog变量
有人知道我是否可以使用变量作为模板名吗?我想要这样的东西:Linux 模板名称中的Rsyslog变量,linux,rsyslog,Linux,Rsyslog,有人知道我是否可以使用变量作为模板名吗?我想要这样的东西: set $.templateName = "\"json_lines_default\""; if $programname contains "app_log" then { set $.templateName = "\"msg_only\""; } action( type="omfwd" template= templateName Target="10.114.22.111" Port="5000
set $.templateName = "\"json_lines_default\"";
if $programname contains "app_log" then {
set $.templateName = "\"msg_only\"";
}
action(
type="omfwd"
template= templateName
Target="10.114.22.111"
Port="5000"
Protocol="tcp"
)
我正在使用Rsyslog 8