# Only connect to rabbitmq user username 'guest' and vhost '/'

**URL:** <https://discuss.elastic.co/t/only-connect-to-rabbitmq-user-username-guest-and-vhost/153563>\
**Category:** Logstash\
**Created:** [October 23, 2018, 9:38am UTC](https://discuss.elastic.co/t/only-connect-to-rabbitmq-user-username-guest-and-vhost/153563 "2018-10-23T09:38:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenyow](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Jenyow](https://discuss.elastic.co/u/Jenyow)\
**Post date:** [October 23, 2018, 9:38am UTC](https://discuss.elastic.co/t/only-connect-to-rabbitmq-user-username-guest-and-vhost/153563/1 "2018-10-23T09:38:14Z")

</div>

Logstash version: 6.4.2  
RabbitMQ version: 3.7.7

My rabbitmq input configuration and rabbitmq users is below:

![QQ%E5%9B%BE%E7%89%8720181023172353](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d54cf2cef14591a0f9e4d07902316c25bcb9b5bc.png)

input {  
rabbitmq {  
type =\>"log"  
host =\> "127.0.0.1"  
port =\> 5682  
vhost =\> "/"  
user =\> "guest"  
password =\> "guest"  
queue =\> "acdp.log"  
exchange =\> "acdp.log"  
exchange\_type =\> "direct"  
key =\> "acdp.log.key"  
durable =\> true  
}   
}

It is success connect to the rabbitmq. The log:

 ![QQ%E5%9B%BE%E7%89%8720181023172828](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fa0b2af5ff506a1c0216a58901bececcc724ca40.png)

When I change vhost to 'acdp', it connected fail:

![QQ%E5%9B%BE%E7%89%8720181023174659](https://us1.discourse-cdn.com/elastic/original/3X/9/5/957d1bd1e2af1526666e35ebac439174700a451a.png)

when I change the user to 'admin', all fail ! The log is difference:

![QQ%E5%9B%BE%E7%89%8720181023174409](https://us1.discourse-cdn.com/elastic/original/3X/6/8/6801be12e2007d248def9505e182936c9b0d1c7e.png)

In the java application all is work. So that, the mq has no problem.  
What is wrong in the logstash configuration ?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 23, 2018, 5:00pm UTC](https://discuss.elastic.co/t/only-connect-to-rabbitmq-user-username-guest-and-vhost/153563/2 "2018-10-23T17:00:53Z")

</div>

Did you check the RabbitMQ log as suggested in the first error message?

---

<div class="post-metadata">

**Author:** ![Jenyow](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Jenyow](https://discuss.elastic.co/u/Jenyow)\
**Post date:** [October 24, 2018, 3:21am UTC](https://discuss.elastic.co/t/only-connect-to-rabbitmq-user-username-guest-and-vhost/153563/3 "2018-10-24T03:21:59Z")

</div>

Thanks. I found the reason.  
My windows install one rabbitmq(port: 5672) and the docker install the same(port: 5682), windows rabbitmq only has the default user and vhost.  
During development, I set the port 5682. Spring boot amqp application is connect to the docker rabbitmq, but the logstash connect to the windows rabbitmq.

---

<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:** [November 21, 2018, 3:22am UTC](https://discuss.elastic.co/t/only-connect-to-rabbitmq-user-username-guest-and-vhost/153563/4 "2018-11-21T03:22:03Z")

</div>

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