Hello everyone,
i have a very basic logstash configuration file.getting multiple log from filebeat.
what i want to do is having different index based on file path.this is what i have done so far for output section:
output {
if [log.file.path] == "/etc/logstash/work_test/something/something.log" {
elasticsearch {
hosts => ["localhost:9200"]
index => "something"
}
}
else {
elasticsearch {
hosts => ["localhost:9200"]
index => "somethingelse"
}
}
}
but the result is one index names something else...it seems that if section is not working but else is working.
what is wrong?
If [log] is an object that contains a field called [file] then in kibana you can refer to log.file, but in logstash you have to refer to [log][file]. It just has a different syntax.
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.