【问题标题】:Consume messages from rabbitmq in logstash在 logstash 中使用来自 rabbitmq 的消息
【发布时间】:2017-08-03 17:37:24
【问题描述】:

我试图从 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 中当然看不到任何日志

队列中有一些消息

【问题讨论】:

    标签: elasticsearch rabbitmq logstash kibana logstash-configuration


    【解决方案1】:

    我认为正确的(默认)端口是 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 {}
    }
    

    【讨论】:

    • 是的,你是对的,我删除了这个参数,因为 5672 是默认值。但它仍然不起作用..现在我最终得到这样的输入input { rabbitmq { host =&gt; "localhost" queue =&gt; "logging_queue" durable =&gt; true } }
    • 您确定队列中有消息吗?
    • 是的,我添加了新屏幕来证明这一点
    • 好的。我运行了错误的文件。只是 logstash.bat 而不是 logstash ......那太愚蠢了......感谢@Val的帮助
    猜你喜欢
    • 1970-01-01
    • 2020-05-15
    • 1970-01-01
    • 2013-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多