0

我試圖從logstash從rabbitmq隊列讀取日誌,然後將其傳遞給elasticsearch。但沒有成功。這是我的logstash配置。在logstash中使用來自rabbitmq的消息

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

但沒有創造那麼ofcourse我看不到任何日誌中Kibana enter image description here

有隊列的一些消息 enter image description here

回答

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 {} 
} 
+0

是的,你是對的,我刪除了這個參數,因爲5672是默認值。但它仍然一點兒也不工作。現在我endup像這樣 '''輸入輸入{ 的RabbitMQ { 主機=> 「本地主機」 隊列=> 「logging_queue」 耐用=>真 } }' ' – TjDillashaw

+0

你確定隊列中有消息嗎? – Val

+0

是的,我添加了新的屏幕來證明 – TjDillashaw