Getting Connection timed out error in logstash

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, 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"
port => 123
user => "myuser"
password => "mypassword"
queue => "topic"
automatic_recovery => true
heartbeat => 30
}
}

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?

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

topic “insuran-note-xyz-queue”

username “xyz”

amq port “222”

i have prepared below logstash config.

input
{
rabbitmq {
host => "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, target virtual host: /, username: xyz", :cause=>#<Java::JavaUtilConcurrent::TimeoutException: >}

Could you please guide me on this?

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 ....

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

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

Or try:

$ 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:

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
1 Like

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, and this.

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
1 Like