# Logstash output to redis

**URL:** https://discuss.elastic.co/t/logstash-output-to-redis/237892
**Category:** Logstash
**Created:** [June 20, 2020, 2:19am UTC](https://discuss.elastic.co/t/logstash-output-to-redis/237892 "2020-06-20T02:19:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kase](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kase](https://discuss.elastic.co/u/kase)
#### Post date: [June 20, 2020, 2:19am UTC](https://discuss.elastic.co/t/logstash-output-to-redis/237892/1 "2020-06-20T02:19:58Z")

</div>

Hi there,  
my logstash will get lots of data from other's API, after filter these data, logstash will output to redis.  
I want to ask some questions:

1. redis is a key-value database, how to let logstash know which is key, others are value?
2. can I send data as JSON type save to redis?
3. I don't want to save all data, can I control logstash to choose which data I want to save to redis?
4. I will use redis to get data I want, and use logstash output to elasticsearch, is there has something I need to notice? and if Q2's answer is yes, JSON type data in logstash will change to array type automatically?

Would you please help me to solve these problems?  
Thanks  
Kase

---

<div class="post-metadata">

### Author: ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)
#### Post date: [June 22, 2020, 7:26am UTC](https://discuss.elastic.co/t/logstash-output-to-redis/237892/2 "2020-06-22T07:26:07Z")

</div>

Hi kase,

Have you had a look at [https://www.elastic.co/guide/en/logstash/current/plugins-outputs-redis.html](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-redis.html)?

This should solve a lot of the doubts you have. For logstash, the final output is a json structure which is a `key-value` structure.

Answers to all your questions is **Yes**. For the last question, you could control the data type using this [setting](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-redis.html#plugins-outputs-redis-data_type).

---

<div class="post-metadata">

### Author: ![kase](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kase](https://discuss.elastic.co/u/kase)
#### Post date: [June 22, 2020, 8:03am UTC](https://discuss.elastic.co/t/logstash-output-to-redis/237892/3 "2020-06-22T08:03:09Z")

</div>

Hi @NerdSec,  
thanks for your answer, yes, I've read this document before, but still not sure it would be work as I predict or not...  
I will try to send data to logstash, see if the result is what I need, then come and share the follow-up, thank you!

---

<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 20, 2020, 8:03am UTC](https://discuss.elastic.co/t/logstash-output-to-redis/237892/4 "2020-07-20T08:03:09Z")

</div>

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