简体   繁体   English

在Logstash中使用Rabbitmq的消息

[英]Consume messages from rabbitmq in logstash

Im trying to read logs from rabbitmq queue from logstash and then pass it to elasticsearch. 我试图从logstash读取rabbitmq队列中的日志,然后将其传递给elasticsearch。 But with no success. 但是没有成功。 Here is my logstash config. 这是我的logstash配置。

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

But there is no index created so ofcourse I cant see any logs in Kibana 但是没有创建索引,所以我看不到Kibana中的任何日志 在此处输入图片说明

There are some messages in queue 队列中有一些消息 在此处输入图片说明

I think the correct (default) port is 5672, as 15672 is the port of the web admin console. 我认为正确的(默认)端口是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 {}
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM