# LOGSTASH and REDIS input - connection refused from redis

**URL:** <https://discuss.elastic.co/t/logstash-and-redis-input-connection-refused-from-redis/49315>\
**Category:** Logstash\
**Created:** [May 5, 2016, 3:15pm UTC](https://discuss.elastic.co/t/logstash-and-redis-input-connection-refused-from-redis/49315 "2016-05-05T15:15:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sin/32/9613_2.png) [@sin](https://discuss.elastic.co/u/sin)\
**Post date:** [May 5, 2016, 3:15pm UTC](https://discuss.elastic.co/t/logstash-and-redis-input-connection-refused-from-redis/49315/1 "2016-05-05T15:15:30Z")

</div>

Hello,

Here's my set-up:

I'm running 1 vagrant vbox containing ELK, and another vagrant vbox containing a redis machine.

On my local machine I'm running a website with a service that sends data to the redis machine.

From my redis machine I want to transfer data to ES and visualize it in Kibana, but for some reason, I cannot seem to make it work between Logstash and Redis.

- Logstash version 2.1.3
- Redis version 3.0.7

Logstash error:  
`{:timestamp=>"2016-05-05T15:03:41.788000+0000", :message=>"Redis connection problem", :exception=>#<Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)>, :level=>:warn}`

Logstash configuration  
`input { redis { host => "127.0.0.1" port => 6379 type => "redis-input" data_type => "list" key => "perf_monitor" } } output { file { path => "/vagrant/log/logstash-output.log" } elasticsearch { hosts => "localhost:9200" index => "perf_monitor" } }`

Worth mentioning:  
Tried the same set-up but with 1.x version of ELK and redis on my local machine (without the vms and everything work perfectly). Switched to VM trying to create a more production-like environment, and everything stopped working.

What might be the problem? What am I doing wrong?

Regards

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 5, 2016, 10:58pm UTC](https://discuss.elastic.co/t/logstash-and-redis-input-connection-refused-from-redis/49315/2 "2016-05-05T22:58:05Z")

</div>

Sounds like a vagrant networking issue, have you forwarded the ports correctly in the config?

---

<div class="post-metadata">

**Author:** ![sin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sin/32/9613_2.png) [@sin](https://discuss.elastic.co/u/sin)\
**Post date:** [May 6, 2016, 9:06am UTC](https://discuss.elastic.co/t/logstash-and-redis-input-connection-refused-from-redis/49315/3 "2016-05-06T09:06:52Z")

</div>

Yes, the ports are forwarded correctly:

- redis:  
`config.vm.network :forwarded_port, guest: 6379, host: 6379`
- ELK:  
`config.vm.network :forwarded_port, guest: 5601, host: 5601 config.vm.network :forwarded_port, guest: 9200, host: 9200 config.vm.network :forwarded_port, guest: 9300, host: 9300`

The interesting thing is that I can connect with a redis desktop client on the redis machine without any issues.

---

<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:** [July 6, 2017, 4:59am UTC](https://discuss.elastic.co/t/logstash-and-redis-input-connection-refused-from-redis/49315/4 "2017-07-06T04:59:03Z")

</div>


