# Accessing Redis cache for dynamic keys

**URL:** <https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209>\
**Category:** Logstash\
**Created:** [May 1, 2019, 1:41pm UTC](https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209 "2019-05-01T13:41:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dipal\_Modi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dipal_modi/32/45326_2.png) [@Dipal\_Modi](https://discuss.elastic.co/u/Dipal_Modi)\
**Post date:** [May 1, 2019, 1:41pm UTC](https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209/1 "2019-05-01T13:41:33Z")

</div>

While using redis input plugin, it requires a key to be specified in the configuration only.

Is there any way to build key using another data source for which we can use redis cache?

The same functionality is available for Memcache though.  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-memcached.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-memcached.html)

I need to create a key using fields coming from the UDP packets.  
input {  
udp {  
host =\> "127.0.0.1"  
port =\> 5555  
codec =\> netflow {  
versions =\> [5, 9, 10]  
}  
}

```
redis {
host => ""
port => 6340
password => ""
}

```

}

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 1, 2019, 1:46pm UTC](https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209/2 "2019-05-01T13:46:26Z")

</div>

> [@Dipal\_Modi](#):
>
> Is there any way to build key using another data source for which we can use redis cache?
> 
> The same functionality is available for Memcache though.

redis is an input, memcache is a filter. logstash can build a key for a filter, but not for an input. Would referencing an [environment variable](https://www.elastic.co/guide/en/logstash/current/environment-variables.html) help?

---

<div class="post-metadata">

**Author:** ![Dipal\_Modi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dipal_modi/32/45326_2.png) [@Dipal\_Modi](https://discuss.elastic.co/u/Dipal_Modi)\
**Post date:** [May 1, 2019, 1:59pm UTC](https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209/3 "2019-05-01T13:59:45Z")

</div>

Then is there any filter available for redis cache or to be build in the future?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 1, 2019, 3:14pm UTC](https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209/4 "2019-05-01T15:14:23Z")

</div>

It is not supported by Elastic, but there is an [open source redis filter](https://github.com/synlay/logstash-filter-cache-redis).

---

<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:** [May 29, 2019, 3:14pm UTC](https://discuss.elastic.co/t/accessing-redis-cache-for-dynamic-keys/179209/5 "2019-05-29T15:14:30Z")

</div>

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