<pre name="code" class="html">Using negation can be useful if you would like to do some generic processing but exclude some specific events. You can use the discard action in conjunction with that. A sample would be:

*.* /var/log/allmsgs-including-informational.log
:msg, contains, "informational" ~
*.* /var/log/allmsgs-but-informational.log
Do not overlook the tilde in line 2! In this sample, all messages are written to the file allmsgs-including-informational.log. Then, all messages containing the string “informational” are discarded. That means the config file lines below the “discard line” (number 2 in our sample) will not be applied to this message. Then, all remaining lines will also be written to the file allmsgs-but-informational.log. 使用否定是有用的,如果 你想要做一些通用的处理 但是需要排除一些特定的事件,你可以使用discard action 连接它 例子如下: *.* /var/log/allmsgs-including-informational.log
:msg, contains, "informational" ~
*.* /var/log/allmsgs-but-informational.log 不要忽视 波浪号 在第2行!在这个例子,所有的消息是写入到文件 allmsgs-including-informational.log. 然后,所有的消息包含字符串 “informational” 是被丢弃的,这意味着 配置文件行 在‘discard line’下 在我们的例子中第2行不会应用这个消息,那么,所有剩下的行业会被写入到文件 allmsgs-but-informational.log.
:msg, contains, “error” ~ # 忽略包含error的日志
												

rsyslog ~ 波浪号的更多相关文章

  1. MacBook Pro/Air 下使用 linux ubuntu 系统 波浪号“~”变成其他 符号 的完美解决办法

    打开终端,输入: sudo su - > /sys/module/hid_apple/parameters/iso_layout sudo su -需要root权限,所以使用前请注意已下载roo ...

  2. jquery选择器空格与大于号、加号与波浪号的区别

    空格:$('parent childchild')表示获取parent下的所有的childchild节点,所有的子孙. 大于号:$('parent > child')表示获取parent下的所有 ...

  3. 波浪号和Hyphen扩展

    Bash将波浪号作为路径扩展符 $echo ~ //扩展为当前用户主目录的全路径名/home/user $echo ~user //扩展为用户user的主目录/home/user $echo ~+ / ...

  4. c#关于路径的总结(转) 虚拟路径波浪号~和斜杠/的区别

    c#关于路径的总结(转)   来源:http://www.cnblogs.com/yugongmengjiutian/articles/5521165.html 前一段时间写代码时经常遇到获取路径问题 ...

  5. c++ 中. 和 ->,波浪号 ~ 符号怎么用 ————很重要

    参考:https://www.cnblogs.com/Simulation-Campus/p/8809999.html 1.  用在类中的析构函数之前,表示该函数是析构函数.如类A的析构函数 clas ...

  6. ; 按快捷键`(即波浪号~所在的键盘按键)立即打开随身U盘中的办公专用文件夹

    ; 按快捷键`(即波浪号~所在的键盘按键)立即打开随身U盘中的办公专用文件夹; WorkFolderHotkey.ahk;; http://www.autoahk.com/; https://www. ...

  7. Git命令中波浪号~与脱字符^的区别

    0.前言 波浪号~,英文名叫 tilde.脱字符^,英文名叫caret. 这两种符号常见于git reset的情景,简单的项目结构和操作一般不会涉及到两者之间的区别,似乎用哪个都可以.如果遇到比较繁杂 ...

  8. C 语言 —— ! 和 ~(感叹号和波浪号)

    ~ 表示按位取反,是位运算符,运算对象是 2 进制. !表示逻辑非,是逻辑运算符,运算对象是真或假.最终的结果也是 0/1 !!:则表示取过一次非之后,再取一次: !!5 ⇒ 1

  9. CSS中“~”(波浪号)、“,”(逗号)、“+”(加号)、“>”(大于号)、“ ”(空格)详解

    “~”:$('pre ~ brother')表示获取pre节点的后面的所有兄弟节点,相当于nextAll()方法: “+”:$('pre + nextbrother')表示获得pre节点的下一个兄弟节 ...

随机推荐

  1. 用document.title=“xxx”动态修改title,在ios的微信下面不生效的解决办法!

    //需要jQuery var $body = $('body'); document.title = 'title'; // hack在微信等webview中无法修改document.title的情况 ...

  2. jquery 实现横向滑动自动切换源码(同时显示多张图片)

    html代码: <!doctype html> <html lang="en"> <head> <meta charset="U ...

  3. eclipse IDE 扩展pydev

    1. 安装PyDev. 运行Eclipse,打开菜单Help->Install New Software.在work with里输入网址:http://pydev.org/updates ,然后 ...

  4. python---连接MySQL第四页

    python缓存结果集式的cursor可以用来提高性能. 例子: #!conding:utf-8 from mysql.connector import errorcode import mysql. ...

  5. eclipse 代码补全

    代码补全 window-> properties -> Java ->Editor ->content Assist -> Auto activation trigger ...

  6. display属性值

    display属性值:none 此元素不会被显示. block 此元素将显示为块级元素,此元素前后会带有换行符. inline 默认.此元素会被显示为内联元素,元素前后没有换行符. inline-bl ...

  7. Div布局案例

    通常看到这个页面,会想到它是有几块组成的. 第一块,分销佣金. 第二块,包括代言.商品.二维码 其中代言又是左右结构. 于是乎基本的div结构就出来了. <div class="row ...

  8. objective-c 可变参数

    容易发现Cocoa Foundation 中提供了一些可变参数的方法,如: NSLog(NSString *format, ...) 在实际的编程实践中,我们也需要自己实现可变参数的方法.在Objc中 ...

  9. Nginx 介绍和安装

    Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev ...

  10. Silk Mobile – 缩短移动应用的测试周期

    Micro Focus已将从Borland接管的Silk Mobile™投放到市场,作为一种新的强大的移动应用测试解决方案,它将使企业能够开发出更先进更可靠的移动商业软件. 作为市场上最完整的移动应用 ...