# Logstash RabbitMQ Input Plugin not recognize host and port

**URL:** <https://discuss.elastic.co/t/logstash-rabbitmq-input-plugin-not-recognize-host-and-port/198070>\
**Category:** Logstash\
**Created:** [September 4, 2019, 3:35pm UTC](https://discuss.elastic.co/t/logstash-rabbitmq-input-plugin-not-recognize-host-and-port/198070 "2019-09-04T15:35:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThiagoBarradas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiagobarradas/32/19624_2.png) [@ThiagoBarradas](https://discuss.elastic.co/u/ThiagoBarradas)\
**Post date:** [September 4, 2019, 3:35pm UTC](https://discuss.elastic.co/t/logstash-rabbitmq-input-plugin-not-recognize-host-and-port/198070/1 "2019-09-04T15:35:42Z")

</div>

Hello Guys!

I'm trying to use Logstash to receive messages from RabbitMQ but it not recognize my configuration, cosidering only `localhost:5672` and failing when tries to connect.

I have already tested the connection with RabbitMQ several times and with many applications, and all works fine.

I'm using Docker to run Logstash, installing RabbitMQ Input Plugin before running Logstash

docker-compose (only logstash part)

```auto
  logstash:
    image: docker.elastic.co/logstash/logstash:7.3.1
    container_name: logstash
    environment:
      - NODE_NAME=my-logstash
      - PATH_CONFIG=/usr/share/logstash/my-confs
    volumes:
      - ./logstash/conf:/usr/share/logstash/my-confs
    command: bash -c "bin/logstash-plugin install logstash-input-rabbitmq && logstash -f /usr/share/logstash/my-confs"
    links:
      - elasticsearch
    depends_on:
      - elasticsearch

```

my conf (only input part)

```auto
input 
{
    rabbitmq
    {
        host => "rabbit.mydomain.com"
        port => 5005
        vhost => "my-vhost"
        user => "user"
        password => "pass"
        queue => "my-queue"
        exchange => "my-exchange"
        exchange_type => "direct"
        durable => true
        automatic_recovery => true
        connect_retry_interval => 10 
        prefetch_count => 10
    }
}

```

Running with debug mode enabled, I can see (showing right configuration)

```auto
logstash | [2019-09-04T15:29:05,950][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@connect_retry_interval = 10
logstash | [2019-09-04T15:29:05,951][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@heartbeat = 30
logstash | [2019-09-04T15:29:05,953][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@automatic_recovery = true
logstash | [2019-09-04T15:29:05,954][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@exchange_type = "direct"
logstash | [2019-09-04T15:29:05,956][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@vhost = "elk"
logstash | [2019-09-04T15:29:05,957][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@durable = true
logstash | [2019-09-04T15:29:05,959][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@port = 5005
logstash | [2019-09-04T15:29:05,960][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@host = ["rabbit.mydomain.com"]
logstash | [2019-09-04T15:29:05,964][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@queue = "my-queue"
logstash | [2019-09-04T15:29:05,961][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@exchange = "my-exchange"
logstash | [2019-09-04T15:29:05,963][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@user = "user"
logstash | [2019-09-04T15:29:05,958][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@password = <password>
logstash | [2019-09-04T15:29:05,959][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@prefetch_count = 10
logstash | [2019-09-04T15:29:05,964][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@enable_metric = true
logstash | [2019-09-04T15:29:05,970][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@threads = 1
logstash | [2019-09-04T15:29:05,973][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@passive = false
logstash | [2019-09-04T15:29:05,975][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@arguments = {}
logstash | [2019-09-04T15:29:05,976][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@auto_delete = false
logstash | [2019-09-04T15:29:05,976][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@exclusive = false
logstash | [2019-09-04T15:29:05,977][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@ack = true
logstash | [2019-09-04T15:29:05,978][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@key = "logstash"
logstash | [2019-09-04T15:29:05,979][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@subscription_retry_interval_seconds = 5
logstash | [2019-09-04T15:29:05,980][DEBUG][logstash.inputs.rabbitmq] config LogStash::Inputs::RabbitMQ/@metadata_enabled = false

```

ERROR in Logstash (see that `localhost:5672` is displayed in this line)

```auto
logstash | [2019-09-04T15:24:34,724][ERROR][logstash.inputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=>"Connection to localhost:5672 refused", :exception=>"MarchHare::ConnectionRefused"}

```

But I need connect to `rabbit.mydomain.com:5005`, like my configuration.

Can someone help me? 🙏

Thx!!

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [September 4, 2019, 3:50pm UTC](https://discuss.elastic.co/t/logstash-rabbitmq-input-plugin-not-recognize-host-and-port/198070/2 "2019-09-04T15:50:31Z")

</div>

> [@ThiagoBarradas](#):
>
> Can someone help me?

This is a [known issue](https://github.com/logstash-plugins/logstash-mixin-rabbitmq_connection/issues/53). According to that you can work around it by using

```
host => "rabbit.mydomain.com:5005"

```

---

<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:** [October 2, 2019, 3:50pm UTC](https://discuss.elastic.co/t/logstash-rabbitmq-input-plugin-not-recognize-host-and-port/198070/3 "2019-10-02T15:50:33Z")

</div>

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