if $programname == "service" then {
if $msg !contains "test" then
action(type="omfwd"
target="10.0.0.5"
...
)
}
Run Code Online (Sandbox Code Playgroud)
我试图排除包含单词 'test' 的消息。不知道如何否定“包含”。
从文档来看,它似乎是“!包含”。尝试过但没有运气。
任何想法?
!否定语法适用于以下形式的遗留选择器
:msg, !contains, "test" /some/file
Run Code Online (Sandbox Code Playgroud)
您正在使用 RainerScript,因此适当的语法是关键字not:
if not ($msg contains "test") then
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9440 次 |
| 最近记录: |