The trouble is that de docs are stored into both index at the same time. Instead to use each own index, one per diferent input.
input {
udp {
host => "192.168.254.60"
port => 5001
type => mikrotik
}
udp {
host => "192.168.254.60"
port => 5000
type => qnap
}
}
filter { ..if [type] == .. }
output {
elasticsearch { hosts => ["192.168.254.50:9200"]
if [type] == "mikrotik" {
index => "mikrotik-%{+YYYY.MM.dd}"
else if [type] == "qnap" {
index => "qnap-%{+YYYY.MM.dd}"
}
}
stdout { codec => rubydebug }
}
}
I use two diferents inputs - filters and outputs with diferent index too but the documents are stored into both index - the same number of docs. The size its diferent because i use diferent index templates with diferent mappings for especific fields.
problem solved.
I was using two different configuration files inside the "config.d" folder - one for each input - filter and output with its specific index. I do not understand it well but on having said this I did not end up squared to logstash - that if I gathered data in both ports udp and created different indexes.
If I use a single configuration file for everything - then every log trace is only stored in its correct index.
Thanks for your time - Christian
input {
udp {
host => "192.168.254.60"
port => 5001
type => mikrotik
}
udp {
host => "192.168.254.60"
port => 5000
type => qnap
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.