【发布时间】:2021-04-22 15:35:51
【问题描述】:
我可以在 rsyslog 配置中同时使用 "$msg contains" 和 "$fromhost-ip startswith" 语句吗?
当我使用 follow 进行 rsyslog 配置时,它可以工作!
if $msg contains 'src_port=6699' then -?DynFileA
& ~
if $fromhost-ip startswith '10.10.10.1' then -?DynFileB
& ~
但是当我将它们结合起来时,它失败了!
if $fromhost-ip startswith '10.10.10.1' and $msg !contains 'src_port=6699' then -?DynFileA
& ~
我从网上搜索了很多文章,尤其是 rsyslog 办公文档,但没有找到任何有用的建议!
谁能告诉我怎么做?
【问题讨论】: