Hi guys.
I'm just wanting to log different event to different indexes and I'm trying to achieve it by using tags.
input {
udp {
port => 25826
type => "collectd"
buffer_size => 1452
codec => collectd { }
}
}
input {
udp {
port => 5514
codec => "json"
type => "sensu"
tags => "sensu"
}
}
Output Filter:
output {
if [@metadata][beat] {
elasticsearch {
hosts => ["server"]
sniffing => true
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
} else {
elasticsearch {
hosts => ["server"]
sniffing => true
manage_template => false
index => "collectd-%{+YYYY.MM.dd}"
document_type => "collectd"
}
}
}
Separate filter for sensu:
output {
if "sensu" in [tags] {
elasticsearch {
hosts => ["server"]
sniffing => true
manage_template => false
index => "sensu-%{+YYYY.MM.dd}"
document_type => "sensu"
}
}
}
When I restart the service I cannot see the data anymore in sensu index, if I remove the if clouse if works , what' wrong, I've already define the tag sensu in the input filter, doesn't it work that way?
What am I doing wrong?
Thanks in advance