# Rabbitmq output plugin - Connection to localhost:5672 failed

**URL:** <https://discuss.elastic.co/t/rabbitmq-output-plugin-connection-to-localhost-5672-failed/182817>\
**Category:** Logstash\
**Created:** [May 26, 2019, 10:34pm UTC](https://discuss.elastic.co/t/rabbitmq-output-plugin-connection-to-localhost-5672-failed/182817 "2019-05-26T22:34:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pouria\_Fewzee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pouria_fewzee/32/44763_2.png) [@Pouria\_Fewzee](https://discuss.elastic.co/u/Pouria_Fewzee)\
**Post date:** [May 26, 2019, 10:34pm UTC](https://discuss.elastic.co/t/rabbitmq-output-plugin-connection-to-localhost-5672-failed/182817/1 "2019-05-26T22:34:22Z")

</div>

Hi,

I receive the following error:

`RabbitMQ connection error, will retry. {:error_message=>"Connection to localhost:5672 failed: timeout", :exception=>"MarchHare::ConnectionRefused"}`

although I'm explicitly defining a host =\> ["{host}:{port}"] pattern in the config file.

Below is my dockerfile:

FROM [docker.elastic.co/logstash/logstash:7.1.0](http://docker.elastic.co/logstash/logstash:7.1.0)

EXPOSE 5044/udp

RUN rm -f /usr/share/logstash/pipeline/logstash.conf

ADD ./configs/logstash.conf /usr/share/logstash/pipeline  
ADD ./configs/logstash.yml /usr/share/logstash/config

and here's my logstash.conf

input {  
syslog {  
port =\> 5044  
type =\> "rsyslog"  
}  
}  
filter {  
}  
output {  
rabbitmq {  
host =\> ["host:port"]  
password =\> "password"  
user =\> "user"  
vhost =\> "vhost"  
exchange =\> "logs"  
exchange\_type =\> "fanout"  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 23, 2019, 10:34pm UTC](https://discuss.elastic.co/t/rabbitmq-output-plugin-connection-to-localhost-5672-failed/182817/2 "2019-06-23T22:34:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
