# Getting Connection timed out error in logstash

**URL:** <https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218>\
**Category:** Logstash\
**Created:** [September 25, 2025, 10:13am UTC](https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218 "2025-09-25T10:13:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![upreddy253](https://avatars.discourse-cdn.com/v4/letter/u/d9b06d/32.png) [@upreddy253](https://discuss.elastic.co/u/upreddy253)\
**Post date:** [September 25, 2025, 10:13am UTC](https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218/1 "2025-09-25T10:13:49Z")

</div>

Hi All,

I have created one logstash pipeline using rabbitmq input plugin. But i am getting below error.

[ERROR] 2025-09-25 09:35:08.167 [[prabbitmq]\<rabbitmq] rabbitmq - RabbitMQ connection error, will retry {:exception=\>MarchHare::ConnectionRefused, :message=\>"Connection timed out. Target host list: [xxxxxxxxxxxxx.com:123](http://xxxxxxxxxxxxx.com:123), target virtual host: /, username: abbcc", :cause=\>#\<Java::JavaUtilConcurrent::TimeoutException: \>}

i have verified connection between rabbitmq servers and logstash using telnet command it is showing connected.

My logstash configuration is

input {  
rabbitmq {  
host =\> "[abc.bcq.com](http://abc.bcq.com)"  
port =\> 123  
user =\> "myuser"  
password =\> "mypassword"  
queue =\> "topic"  
automatic\_recovery =\> true  
heartbeat =\> 30  
}  
}

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [September 25, 2025, 12:34pm UTC](https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218/2 "2025-09-25T12:34:13Z")

</div>

> JavaUtilConcurrent::TimeoutException  
> It's something related to:

- open network path, LS server must be able to reach RMQ on the target port
- correct hostname, username/pass
- ssl connection, maybe to set: `ssl => false`, if you are not using.

Can you confirm that you have tested telnet from LS to rabbitmq on port 123? Not from your host or any other.  
Have you checked RMQ logs? Any trace on that side? FW log, RMQ log, anything?

---

<div class="post-metadata">

**Author:** ![upreddy253](https://avatars.discourse-cdn.com/v4/letter/u/d9b06d/32.png) [@upreddy253](https://discuss.elastic.co/u/upreddy253)\
**Post date:** [October 7, 2025, 7:45am UTC](https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218/3 "2025-10-07T07:45:22Z")

</div>

Hi Rios,

Thanks for responding!

I have tried telnet from logstash server to above mentioned host. it shows connected. I have tried with both ssl true and false also it is not working.

Here i am sharing all details.

I have received below details from client.

broker “[abc.bcq.co.net:123](http://abc.bcq.co.net:123)”

topic “insuran-note-xyz-queue”

username “xyz”

amq port “222”

i have prepared below logstash config.

input  
{  
rabbitmq {  
host =\> "[abc.bcq.co.net:123](http://abc.bcq.co.net:123)"  
port =\> 222  
user =\> "xyz"  
password =\> "mypassword"  
queue =\> "insuran-note-xyz-queue"  
codec =\> json {}  
}  
}

In above config i have tried with port value is 123 also, but it is not working getting same error.

getting below error

[ERROR] 2025-10-07 06:20:39.224 [[pmmcrabbitmq]\<rabbitmq] rabbitmq - RabbitMQ connection error, will retry {:exception=\>MarchHare::ConnectionRefused, :message=\>"Connection timed out. Target host list: [abc.bcq.co.net:222](http://abc.bcq.co.net:222), target virtual host: /, username: xyz", :cause=\>#\<Java::JavaUtilConcurrent::TimeoutException: \>}

Could you please guide me on this?

---

<div class="post-metadata">

**Author:** ![RainTown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raintown/32/140206_2.png) [@RainTown](https://discuss.elastic.co/u/RainTown)\
**Post date:** [October 8, 2025, 10:32am UTC](https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218/4 "2025-10-08T10:32:43Z")

</div>

First of all, don't post same query multiple times please.

You basically have a network connectivity issue here, not really a logstash issue.

Is it port 123 or port 222 or ...

(btw default AMQ port is 5672.) . So ....

> [@upreddy253](#):
>
> I have received below details from client

... suggests to me some sort of proxy is in between.

> [@upreddy253](#):
>
> I have tried telnet from logstash server to above mentioned host. it shows connected

OK, type HELO and hit return a few times. What do you see?

Or try:

```auto
$ echo -ne 'AMQP\x00\x00\x09\x01' | nc -w 3 abc.bcq.co.net 123 | xxd -g 1

```

and see what you get.

While making these connection attempts, look (or ask someone to look) at your rabbitmq logs, you should see stuff like:

```auto
2025-10-08 10:26:21.250867+00:00 [info] <0.851.0> accepting AMQP connection 192.168.65.1:34375 -> 172.17.0.2:5672

```

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [October 9, 2025, 4:03am UTC](https://discuss.elastic.co/t/getting-connection-timed-out-error-in-logstash/382218/5 "2025-10-09T04:03:06Z")

</div>

> [@RainTown](#):
>
> You basically have a network connectivity issue here, not really a logstash issue.

I share the same opinion. However, he share only a single log line. No easy to move forward without more details.  
There are similar [issues with RMQ](https://github.com/logstash-plugins/logstash-mixin-rabbitmq_connection/issues/52), and [this](https://github.com/logstash-plugins/logstash-input-rabbitmq/issues/115).

upreddy253 Please provide next information:

- Have you tried with specifying port in host parameter  
`host => "abc.bcq.com:123"`
- Logstash version, is it docker or normal
- LS logs in debug mode, few lines not just single line where is the error.
- Have you checked RMQ side is there trace of any network connectivity in host or RMQ logs
