# Redis-logstash-elasticsearch

**URL:** <https://discuss.elastic.co/t/redis-logstash-elasticsearch/28307>\
**Category:** Logstash\
**Created:** [August 30, 2015, 10:50am UTC](https://discuss.elastic.co/t/redis-logstash-elasticsearch/28307 "2015-08-30T10:50:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![azeiner](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@azeiner](https://discuss.elastic.co/u/azeiner)\
**Post date:** [August 30, 2015, 10:50am UTC](https://discuss.elastic.co/t/redis-logstash-elasticsearch/28307/1 "2015-08-30T10:50:45Z")

</div>

hi everybody,

since i'm new to elasticsearch and logstash i wanted to ask what some of you would consider as best practice to get data via logstash from redis to elasticsearch.

we have a sorted timeset in redis with a json string as memberattribute e.g.

timeset1, datetimescore, {'name':'name1', 'attr1':'attrvalue1' ... 'attr16':'attrvalue16' }

we are using redis as a kind of daily buffer for our measurement data and there will be up to 5.000.000 records per day which should be transfered via logstash.

we've tried a few things and i just wanted to ask a few short questions additionally:

- logstash is a continously running service when started, right? so it constantly transfering data from redis to elasticsearch?
- since we've a json string, what is the best way to import this into elasticsearch to have the opportunity to analyse every attribute data of the json string.
- how does an efficient logstash config look like for such a task?

thanks for you support and help!

best andy

---

<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 30, 2015, 11:47am UTC](https://discuss.elastic.co/t/redis-logstash-elasticsearch/28307/2 "2015-08-30T11:47:50Z")

</div>

> logstash is a continously running service when started, right? so it constantly transfering data from redis to elasticsearch?

Yes.

> since we've a json string, what is the best way to import this into elasticsearch to have the opportunity to analyse every attribute data of the json string.

If each message is a complete JSON object you can use the [json codec](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-json.html) (`codec => json`) for the redis input (which is actually the default). Otherwise you can use the [json filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html).

> how does an efficient logstash config look like for such a task?

You don't need to do anything special to make it efficient, especially not for a mere 5M msg/day. Just add a [redis input](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-redis.html) and an [elasticsearch output](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html), plus any filters that you might need.

```
input {
  redis {
    host => "redishost.example.com"
  }
}

output {
  elasticsearch {
    host => ["localhost"]
    protocol => "http"
  }
}

```

---

<div class="post-metadata">

**Author:** ![azeiner](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@azeiner](https://discuss.elastic.co/u/azeiner)\
**Post date:** [August 30, 2015, 8:40pm UTC](https://discuss.elastic.co/t/redis-logstash-elasticsearch/28307/3 "2015-08-30T20:40:25Z")

</div>

thanks a lot!!! i'll give it a try tomorrow! thanks again! best andy

---

<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, 5:30am UTC](https://discuss.elastic.co/t/redis-logstash-elasticsearch/28307/4 "2017-07-06T05:30:37Z")

</div>


