Filter 对数存储过滤段
您能建议如何使用Logstash 1.5过滤特定单词吗?例如,有必要过滤以下单词:临界、退出、未连接。 我记得,在以前版本的Logstash(即1.4和更早版本)中,可以使用grep过滤器 当前我的logstash.conf包含:Filter 对数存储过滤段,filter,logstash,zabbix,Filter,Logstash,Zabbix,您能建议如何使用Logstash 1.5过滤特定单词吗?例如,有必要过滤以下单词:临界、退出、未连接。 我记得,在以前版本的Logstash(即1.4和更早版本)中,可以使用grep过滤器 当前我的logstash.conf包含: input { file { path => ["C:\ExportQ\export.log"] type => "Exporter-log" codec => plain { charset => "C
input {
file {
path => ["C:\ExportQ\export.log"]
type => "Exporter-log"
codec => plain {
charset => "CP1251"
}
start_position => "beginning"
sincedb_path => "C:\Progra~1\logstash\sincedb"
}
}
filter {
}
output {
stdout { codec => rubydebug }
zabbix {
zabbix_host => "VS-EXP"
zabbix_key => "log.exp"
zabbix_server_host => "192.168.1.71"
zabbix_value => "message"
}
}
}
非常感谢 使用条件和下拉筛选器删除匹配的邮件
filter {
# Simple substring condition
if "boring" in [message] {
drop { }
}
# Regexp match
if [message] =~ /boring/ {
drop { }
}
}
马格纳斯,谢谢你的回复!但任何包含关键字(临界、退出、未连接)的字符串都必须发送到输出(zabbix插件)。可以跳过/删除所有其他消息。我可以在这种情况下使用:if[消息]!~/错误|严重/?是,只需否定条件即可。