# Logstash RabbitMQ Output

**URL:** <https://discuss.elastic.co/t/logstash-rabbitmq-output/129051>\
**Category:** Logstash\
**Created:** [April 23, 2018, 7:53am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051 "2018-04-23T07:53:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul.rapp](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@paul.rapp](https://discuss.elastic.co/u/paul.rapp)\
**Post date:** [April 23, 2018, 7:53am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051/1 "2018-04-23T07:53:42Z")

</div>

I am having trouble getting logstash to output to rabbit on a non-default port.

My output configuration for logstash is ...

rabbitmq {  
durable =\> "true"  
persistent =\> "true"  
exchange =\> "secure-logs-exch"  
exchange\_type =\> "direct"  
vhost =\> "logstash\_secure-ci"  
key =\> "secure.apps.logs"  
user =\> "logstash"  
password =\> "password"  
host =\> "prcore"  
port =\> "6672"  
}

My rabbitmq server is listening on 6672.

But from the logstash logs I see the following...

**[2018-04-23T08:23:59,999][ERROR][logstash.outputs.rabbitmq] RabbitMQ connection error, will retry. {:error\_message=\>"Connection to localhost:5672 refused", :exception=\>"MarchHare::ConnectionRefused"}**

And a tcpdump on the target server shows...

**08:38:43.659744 IP 192.168.10.4.45614 \> 192.168.10.2.amqp: Flags [S], seq 3659372810, win 29200, options [mss 1460,sackOK,TS val 1146040 ecr 0,nop,wscale 7], length 0**  
**08:38:43.659793 IP 192.168.10.2.amqp \> 192.168.10.4.45614: Flags [R.], seq 0, ack 3659372811, win 0, length 0**

I am using Logstash 6.2.3, and Rabbit 3.7.3 (Erlang 20.3) - I have also had this on an earlier version of RabbitMQ.

Thanks for any help anyone can give.

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [April 23, 2018, 8:33am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051/2 "2018-04-23T08:33:52Z")

</div>

> [@paul.rapp](#):
>
> Flags [R.]

`Reset`

Anything in your RBMQ logs to denote why the connection was closed?

---

<div class="post-metadata">

**Author:** ![paul.rapp](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@paul.rapp](https://discuss.elastic.co/u/paul.rapp)\
**Post date:** [April 23, 2018, 8:41am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051/3 "2018-04-23T08:41:11Z")

</div>

Nothing comes in to RBMQ logs at all.

RBMQ is listening on 6672, and all the network traffic from logstash hits the server on 5672.

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [April 23, 2018, 9:41am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051/4 "2018-04-23T09:41:51Z")

</div>

> [@paul.rapp](#):
>
> Nothing comes in to RBMQ logs at all.

Okay perhaps we are not getting that far downstream

I presume both services are running on the same server?  
`netstat |grep 5672` Are we listening on the needful port?

---

<div class="post-metadata">

**Author:** ![paul.rapp](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@paul.rapp](https://discuss.elastic.co/u/paul.rapp)\
**Post date:** [April 23, 2018, 9:49am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051/5 "2018-04-23T09:49:38Z")

</div>

No they are running on different servers.  
Logstash is running on one server and rabbitmq on a different server.

There are no firewalls on either server.

netstat gives the following ...  
netstat -an | grep 672  
tcp 0 0 0.0.0.0:25672 0.0.0.0:\* LISTEN  
tcp 0 0 0.0.0.0:15672 0.0.0.0:\* LISTEN  
tcp6 0 0 :::6672 :::\* LISTEN

---

<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:** [May 21, 2018, 9:49am UTC](https://discuss.elastic.co/t/logstash-rabbitmq-output/129051/6 "2018-05-21T09:49:44Z")

</div>

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