Hi,
I am trying to use multiple templates for the indexes in the output section in logstash.conf, but it is always ignoring one of the templates.
Sample conf:
output {
if [type] == "log1" {
elasticsearch { hosts => ["localhost:9200"]
index => "sample1-%{+MM.YYYY}"
template => "/root/logstash-2.2.2/log1.json"
manage_template => true
template_overwrite => true
}
}
if [type] == "log2" {
elasticsearch { hosts => ["localhost:9200"]
index => "sample2-%{+MM.YYYY}"
template => "/root/logstash-2.2.2/log2.json"
manage_template => true
template_overwrite => true
}
}
}
Also suggest me a good example for this kind of configuration.
Thanks in advance.