0

我在本地部署了一个 logstash 实例,我正试图将它包裹起来。我在 logstash.conf 文件中添加了一个简单的 grep 过滤器,但是当我重新启动服务时,它失败了。当我删除 grep 语句时,它工作正常。这是我的配置。任何帮助,将不胜感激。谢谢。

input {
        kafka {
        zk_connect => "localhost:9091"
        topic_id => "rawlog"
        reset_beginning => false
        consumer_threads => 1
        consumer_restart_on_error => true
        consumer_restart_sleep_ms => 100
        decorate_events => false
    }

}
output {
  elasticsearch {
    bind_host => "localhost"
    protocol => "http"
  }
}
filter {
  grep {
    match => {"message"=>"hello-world"}
  }
}
4

1 回答 1

2

grep{} 已弃用,取而代之的是条件和 drop{}:

filter {
  if [message] !~ /hello-world/ {
    drop{}
  }
}

如果这没有帮助,请发布您的输入示例。

于 2015-04-29T17:53:17.813 回答