在logstash中使用来自rabbitmq的消息

时间:2017-08-03 17:37:24

标签: elasticsearch rabbitmq logstash kibana logstash-configuration

我试图从logstash中读取rabbitmq队列中的日志,然后将其传递给elasticsearch。但没有成功。这是我的logstash配置。

input {
    rabbitmq {
        host => "localhost"
        port => 15672
        heartbeat => 30
        durable => true
        exchange => "logging_queue"
        exchange_type => "logging_queue"
    }
}
output {
    elasticsearch {
        hosts => "localhost:9200"
    }
    stdout {}
}

但是没有创建索引,因此我无法在Kibana中看到任何日志 enter image description here

队列中有一些消息 enter image description here

1 个答案:

答案 0 :(得分:0)

我认为正确的(默认)端口是5672,因为15672是Web管理控制台的端口。

input {
    rabbitmq {
        host => "localhost"
        port => 5672                  <--- change this
        heartbeat => 30
        durable => true
        exchange => "logging_queue"
        exchange_type => "logging_queue"
    }
}
output {
    elasticsearch {
        hosts => "localhost:9200"
    }
    stdout {}
}