Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 模板名称中的Rsyslog变量_Linux_Rsyslog - Fatal编程技术网

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