# Use redis to create session and add the session id to each log event in logstash

**URL:** <https://discuss.elastic.co/t/use-redis-to-create-session-and-add-the-session-id-to-each-log-event-in-logstash/123488>\
**Category:** Logstash\
**Created:** [March 12, 2018, 6:55am UTC](https://discuss.elastic.co/t/use-redis-to-create-session-and-add-the-session-id-to-each-log-event-in-logstash/123488 "2018-03-12T06:55:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind\_Kumar1988](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Arvind\_Kumar1988](https://discuss.elastic.co/u/Arvind_Kumar1988)\
**Post date:** [March 12, 2018, 6:55am UTC](https://discuss.elastic.co/t/use-redis-to-create-session-and-add-the-session-id-to-each-log-event-in-logstash/123488/1 "2018-03-12T06:55:14Z")

</div>

Filebeat sends log events to our logstash server. Each log event has a client id which is basically a machine id of the client who generate the event. Using this client id I want to generate a session id and save this in redis. This session will be valid for 30 mins. Each log event will be associated with this session id. After session expires, a new session id is generated and again repeat the same process as above. This will be done for each unique client id. How can I use redis to read and write session into using "filters"?

---

<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:** [April 9, 2018, 6:55am UTC](https://discuss.elastic.co/t/use-redis-to-create-session-and-add-the-session-id-to-each-log-event-in-logstash/123488/2 "2018-04-09T06:55:33Z")

</div>

Closed on April 9, 2018, 6:55am UTC

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