# Redis input socketerror, Error: initialize: name or service not known

**URL:** <https://discuss.elastic.co/t/redis-input-socketerror-error-initialize-name-or-service-not-known/137721>\
**Category:** Logstash\
**Created:** [June 28, 2018, 3:07am UTC](https://discuss.elastic.co/t/redis-input-socketerror-error-initialize-name-or-service-not-known/137721 "2018-06-28T03:07:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![layla](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@layla](https://discuss.elastic.co/u/layla)\
**Post date:** [June 28, 2018, 3:07am UTC](https://discuss.elastic.co/t/redis-input-socketerror-error-initialize-name-or-service-not-known/137721/1 "2018-06-28T03:07:08Z")

</div>

I have configured a logstash before the log comes to elasticache for redis, below is the configuration and I can send the syslog to elasticache for redis successfully.

```
indent preformatted text by 4 spaces
 input {
    stdin {
    }
}

output {
    redis {
            host => "amazonaws.com:6379"
            data_type => "list"
            key => "logstash"
    }
} 

```

However, I also put an instance after elasticache for redis, I have set below configuration but logstash cannot get the data from elasticache, and I have also get the below error from logstash log. Please kindly help!

```
indent preformatted text by 4 spaces
input {
    redis {
            host => "amazonaws.com:6379"
            #type => "redis-input"
            data_type => "list"
            key => "logstash"
            codec => "json"
    }
}

output {
    amazon_es {
            hosts => "ap-southeast-1.es.amazonaws.com"
            region => "ap-southeast-1"
            aws_access_key_id =>'######'
            aws_secret_access_key => '######'
    }
}
```

---

<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:** [June 28, 2018, 6:52am UTC](https://discuss.elastic.co/t/redis-input-socketerror-error-initialize-name-or-service-not-known/137721/2 "2018-06-28T06:52:56Z")

</div>

The hostname in the redis input isn't the same as in the redis output. The latter resolves correctly in DNS but the former doesn't.

---

<div class="post-metadata">

**Author:** ![layla](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@layla](https://discuss.elastic.co/u/layla)\
**Post date:** [June 28, 2018, 7:44am UTC](https://discuss.elastic.co/t/redis-input-socketerror-error-initialize-name-or-service-not-known/137721/3 "2018-06-28T07:44:09Z")

</div>

Oh yes!! Thanks for pointing out the mistake! It works now!

---

<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 26, 2018, 7:44am UTC](https://discuss.elastic.co/t/redis-input-socketerror-error-initialize-name-or-service-not-known/137721/4 "2018-07-26T07:44:30Z")

</div>

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