例如,你有一个日志stream进入某个地方(系统日志服务器,转发Windows事件日志,“典型贫穷的系统pipe理员的邮箱”,一个Splunk索引器,无论什么…)
想象一下这个未分类,未经过滤的日志stream,有些是独一无二的,每天只会发生一次:
5 Feb 2014 cake: Kernel panic - not syncing: Fatal exception. Backtrace: .... 5 Feb 2014 cake: Kernel panic - not syncing: Fatal exception. Backtrace: ....其他人将像雪崩一样:
smbd/server.c:open_sockets_smbd(491) Reloading services after SIGHUP : 1 Time(s) smbd/server.c:open_sockets_smbd(491) Reloading services after SIGHUP : 2 Time(s) (和另外的100次)
什么是去除重复和总结日志的技术?
一些需要以上所有stream的东西,并做一个简洁的总结:
严重错误:
蛋糕Kernel panic - not syncing: Fatal exception. Backtrace: .... Kernel panic - not syncing: Fatal exception. Backtrace: ....
频繁未知的日志:
someserver smbd/server.c:open_sockets_smbd(491) Reloading services after SIGHUP : X Time(s) (重复100次)
somethingerver apache GET /some/imaginary/example (重复35次)
等等
通常情况下,这是所有日志分析和日志pipe理工具中的function,这些术语是我期望描述将机器生成的数据转换为智能的过程的术语。
如果要在分析减less可pipe理报告之前减less存储的数据量,请执行以下操作:
大多数软件都带有configuration开关,减less了日志消息的数量和冗长。
rsyslog提供了$ RepeatedMsgReductionconfiguration开关,通过logging“最后一行重复n次”,将这样的重复消息变成一个。
如果你使用的是rsyslog,你也可以select很容易地过滤消息。 丢弃消息的基本示例是:
# /etc/rsyslog.cof # These rules filter messages: :msg, contains, "smbd/server.c:open_sockets_smbd" ~
代字符~是丢弃包含string“smbd / server.c:open_sockets_smbd”的消息的指令。