使用 man ascii 来查看 ASCII 表。

Logstash 6.4判断语法语法是不是修改了。

Logstash | 作者 sunjj | 发布于2018年09月27日 | 阅读数:2126

input {
redis {
host => "192.168.1.202"
port => "6379"
db => "0"
password => "123456"
data_type => "list"
key => "filebeat"
}
}
output {
filter {
if [key] == "filebeat" {
stdout {
codec=>rubydebug{}
}
}
}
}

为什么会收集不到信息,是不是我的判断语法有问题,如果我把判断语法去掉就能出信息了。求助大神!
已邀请:

rochy - rochy_he

赞同来自: sunjj

你需要去掉 output 中的 filter,请参考官方的示例:
output {
if [type] == "apache" {
if [status] =~ /^5\d\d/ {
nagios { ... }
} else if [status] =~ /^4\d\d/ {
elasticsearch { ... }
}
statsd { increment => "apache.%{status}" }
}
}

sunjj - 天不怕地不怕,就怕写代码!

赞同来自:

谢谢!

要回复问题请先登录注册