# Rabbitmq as logstash input

**URL:** <https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756>\
**Category:** Logstash\
**Created:** [August 3, 2017, 6:02pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756 "2017-08-03T18:02:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Dziubecki](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@Daniel\_Dziubecki](https://discuss.elastic.co/u/Daniel_Dziubecki)\
**Post date:** [August 3, 2017, 6:02pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756/1 "2017-08-03T18:02:12Z")

</div>

Im trying to read logs from rabbitmq queue from logstash and then pass it to elasticsearch. But with no success. Here is my logstash config.

```
input {
    rabbitmq {
        host => "localhost"
        port => 15672
        heartbeat => 30
        durable => true
        exchange => "logging_queue"
        exchange_type => "logging_queue"
    }
}
output {
    elasticsearch {
        hosts => "localhost:9200"
    }
    stdout {}
}

```

RabbitMQ panel

 ![Ou6ma](https://us1.discourse-cdn.com/elastic/original/3X/0/2/027543a6d656c3e7fe629a93104d19d9e57a4c97.png)

But there is no index created so ofcourse I cant see any logs in Kibana

 ![KwMkP](https://us1.discourse-cdn.com/elastic/original/3X/c/d/cdde53e43b62f23fdd4c5fdaa3481a5fabc107a3.png)

---

<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:** [August 3, 2017, 6:16pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756/2 "2017-08-03T18:16:10Z")

</div>

Comment out the elasticsearch output and use a `stdout { codec => rubydebug }` output when debugging.

Your screen dump shows the logging\_queue exchange, not a queue. You should make sure to name your queue so that it won't be disappear when Logstash disconnects. The documentation of the plugin's `queue` option is unfortunately broken and contains lots of irrelevant stuff (I'll send a PR), but here's the important part:

> The name of the queue Logstash will consume events from. If left empty, a transient queue with an randomly chosen name will be created.

So are any messages being published and routed to the queue? Is Logstash trying to consume from the queue? Are there any clues in the Logstash logs?

---

<div class="post-metadata">

**Author:** ![Daniel\_Dziubecki](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@Daniel\_Dziubecki](https://discuss.elastic.co/u/Daniel_Dziubecki)\
**Post date:** [August 3, 2017, 6:45pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756/3 "2017-08-03T18:45:00Z")

</div>

Okay, Ive made some fixes.

```
input {
    rabbitmq {
      host => "localhost"
      queue => "logging_queue"
      durable => true
   }
}
output {
   stdout { codec => rubydebug }
}

```

I have 7 messages in my queue

 ![Przechwytywanie](https://us1.discourse-cdn.com/elastic/original/3X/1/2/12057de90a8bc53514d63197c6c50db60bf9bae6.JPG)

But It still does'nt work and there is nothing special in logs

> [2017-08-03T20:15:20,666][INFO][logstash.runner] Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash  
> [2017-08-03T20:15:48,140][INFO][logstash.runner] Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash  
> [2017-08-03T20:16:58,204][INFO][logstash.runner] Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash  
> [2017-08-03T20:20:14,080][INFO][logstash.runner] Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash  
> [2017-08-03T20:37:39,264][INFO][logstash.runner] Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash

---

<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:** [August 3, 2017, 6:48pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756/4 "2017-08-03T18:48:13Z")

</div>

> [2017-08-03T20:37:39,264][INFO][logstash.runner] Using config.test\_and\_exit mode. Config Validation Result: OK. Exiting Logstash

And if you actually start Logstash instead of just running it in test-configuration-and-exit-mode?

---

<div class="post-metadata">

**Author:** ![Daniel\_Dziubecki](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@Daniel\_Dziubecki](https://discuss.elastic.co/u/Daniel_Dziubecki)\
**Post date:** [August 3, 2017, 7:00pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756/5 "2017-08-03T19:00:23Z")

</div>

Okay. I was running wrong file. Just logstash.bat instead of logstash ... that was stupid 🙂 Thanks Magnus

---

<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:** [August 31, 2017, 7:00pm UTC](https://discuss.elastic.co/t/rabbitmq-as-logstash-input/95756/6 "2017-08-31T19:00:25Z")

</div>

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