Hi,
I have a bunch of logstash (2.4.0) nodes with this output config:
output {
if [environment] == "stage" {
elasticsearch {
hosts => [ "elasticsearch-01" ]
index => "logstash-stage-%{+YYYY.MM.dd}"
}
} else {
elasticsearch {
hosts => [ "elasticsearch-01" ]
index => "logstash-%{+YYYY.MM.dd}"
}
}
}
The idea is of course that logs with the environment field set to stage should go into the logstash-stage index. This is not working as intended because it goes to both indices i.e. the same event is found under both logstash-stage and logstash-. This only happens for events with environment == stage, other events only goes to logstash- as they should. What am I doing wrong?
Thanks,