Logstash中缺少grep过滤器

森人

我正在尝试使用grep函数,但是它不起作用,

这是错误:

Couldn't find any filter plugin named 'grep'. Are you sure this is correct?    
Trying to load the grep filter plugin resulted in this error: no such file to 
load -- logstash/filters/grep

这是我的文件logstash.conf

input {
stdin { }
file {
type => "FireWall"
path => "/var/log/test.txt"
start_position => 'beginning'
}
}
filter {


grep {

    match =>["message",".* Morito .*"]
 }
grok {

patterns_dir => "./patterns"
   match => [
    "message", "%{WORD:firstname} %{WORD:lastname} %{NUMBER:age}    
]
}
}
output {
stdout { }
elastic search {
cluster => "logstash"
}
}

我该怎么办?

阿兰·柯林斯(Alain Collins)

放弃了grep {},转而使用有条件的条件和drop {}:

if [message] =~ /regexp/ {
     drop{}
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章