Hi folks,
I'm using logstash to read from 2 rabbitMQ queues and write to two different locations in S3. Data from one queue will go to one location in S3, and data from the other queue will go to a different location in S3. I'm having difficulty configuring this. I realize that I need to use conditionals to set the appropriate output plugin, but the conditional is not correct and all of the data is written to one location in S3.
Here is the structure of my configuration file. I've omitted details about the queues and S3 locations for clarity. It seems like the conditional is always evaluating to false, because I keep writing to the output location specified in the else clause.
Any insight on how to fix this, or any techniques for testing the configuration, would be greatly appreciated.
Thanks,
Matt
Here's my abbreviated configuration
input {
rabbitmq {
id => "rabbitmq_logstash_ingest"
queue => "test-logstash"
}
rabbitmq {
id => "rabbitmq_logstash_ingest"
queue => "test-logstash2"
}
}
filter {
if [rabbitmq][queue] == "test-logstash" {
metrics {
meter => "events"
add_tag => "metric"
}
}
else {
metrics {
meter => "events"
add_tag => "metric2"
}
}
}
output {
if [rabbitmq][queue] == "test-logstash" {
s3 {
bucket => "data-test-bucket"
id => "rabbitmq_logstash_s3_output"
prefix => "logstash-throughput/%{+YYYYMMdd_HH}"
}
} else {
s3 {
bucket => "samba-eurozone-data-test"
id => "rabbitmq_logstash_s3_output2"
prefix => "logstash-throughput2/%{+YYYYMMdd_HH}"
}
}
}