悟空,拿我的打狗棒来

logstash conf文件 启动报错

Logstash | 作者 redhat | 发布于2017年06月02日 | 阅读数:4298

filter{
if([messageTopic] == "minos2_useraction"){
# codec=>rubydebug
mutate{
split=>["message"," "]
add_field => {
"eventName" => "%{[message][0]}"
}

add_field => {
"eventId" => "%{[message][1]}"
}
add_field => {
"ruleId" => "%{[message][2]}"
}
add_field => {
"serialNumber" => "%{[message][3]}"
}
add_field => {
"mainBody" => "%{[message][4]}"
}
add_field => {
"ip" => "%{[message][5]}"
}


remove_field => ["message"]

# if([ip] != "-") {
# geoip {
# source => "ip"
# target => "geoip"
# }
# }
}

# if([ip] != "-") {
# geoip {
# source => "ip"
# target => "geoip"
# }
}
我的filter设置如上,先获取ip,然后将ip值不为“-”的转换为geoip,但是上面两种配置方式都是错的,求大神指导
已邀请:

wyntergreg

赞同来自:

#               if([ip] != "-") {
# geoip {
# source => "ip"
# target => "geoip"
# }
# }
}
你屏蔽大括号的方式真是清奇,强迫症犯了

要回复问题请先登录注册