I have a logstash instance with the following configuration (simplified):
input {
redis { }
}
output {
elasticsearch_http { }
if [level] == "WARNING" or [level] == "ERROR" or [level] == "CRITICAL" or [level] == "ALERT" or [level] == "EMERGENCY" {
if [type] == "specific type 1" {
sentry { }
} else if [type] == "specific type 2" {
sentry { }
} else if [type] == "specific type 3" {
sentry { }
}
}
}
As you can see, every message goes to elasticsearch and based on the type it gets send to the sentry output (custom plugin I wrote to write messages to sentry). For each specific type I have a separate project in sentry and the sentry plugin is configured to know to which project it needs to send the message.
Everything is working except that messages get send to the wrong projects in senty. Occasionally, it seems like the if's are doing their job and messages end up in the correct project in sentry. But the majority of the time, messages get send to the first project.
Does anybody have any idea if there is something wrong with this configuration or how I can debug this? Because I'm really lost and can't see anything wrong with this.