假设我有一个logstash服务器塞满了日志被定期加载,是否有一个相当优雅的方式,我可以尾随Logstash服务器上的连续执行查询的结果,并显示在terminal窗口
例如
some-special-logstash-command.sh | egrep -v "(searchword1|searchword2)"
这个想法是,命令pipe道的东西超出logstash和我的grep查询filter,并显示我的过滤输出。
..当然,如果有一个logstash命令可以为我做的grep片,那么也工作:)
这样做的动机是,假设我所有的事件都来自我的房地产正在加载到logstash,那么将有一个terminal窗口连续尾部的有趣的事件,因为他们发生滚动屏幕。
-高手
在logstash
收集器中包含configuration来执行grep
工作并输出到stdout
。 这是一个使用file
input的例子:
input { file { add_field => ... # hash (optional), default: {} codec => ... # codec (optional), default: "plain" discover_interval => ... # number (optional), default: 15 exclude => ... # array (optional) path => ... # array (required) sincedb_path => ... # string (optional) sincedb_write_interval => ... # number (optional), default: 15 start_position => ... # string, one of ["beginning", "end"] (optional), default: "end" stat_interval => ... # number (optional), default: 1 tags => ... # array (optional) type => ... # string (optional) } } filter { grep { add_field => ... # hash (optional), default: {} add_tag => ... # array (optional), default: [] drop => ... # boolean (optional), default: true ignore_case => ... # boolean (optional), default: false match => ... # hash (optional), default: {} negate => ... # boolean (optional), default: false remove_field => ... # array (optional), default: [] remove_tag => ... # array (optional), default: [] } } output { stdout {} }