gpt4 book ai didi

grep - Logstash 中缺少 grep 过滤器

转载 作者:行者123 更新时间:2023-12-02 01:58:36 26 4
gpt4 key购买 nike

我正在尝试使用 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"
}
}

请问我该怎么办?

最佳答案

grep{} 被删除,取而代之的是条件语句和 drop{}:

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

关于grep - Logstash 中缺少 grep 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29609355/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com