i'm using logstash to send data from 2 different input:files and elastic search:
input {
elasticsearch{
hosts => "http://server_name:9200"
type => "host1"
}
file{
path => "/home/sana/pfe/docker/logs/**/*.log"
type => "host2" }}
now i want to put each data in diffrent index in my local elasticsearch using this method:
if "host1" in [type]{
elasticsearch{ hosts => ["localhost:9200"]
index => ["integrationlogs"] }
}
if "host2" in [type]{
elasticsearch{ hosts => ["localhost:9200"]
index => ["locallogs"] }
}
please what is the correct way to handle this