# How to enable cache in logstash

**URL:** <https://discuss.elastic.co/t/how-to-enable-cache-in-logstash/294126>\
**Category:** Logstash\
**Created:** [January 12, 2022, 8:45am UTC](https://discuss.elastic.co/t/how-to-enable-cache-in-logstash/294126 "2022-01-12T08:45:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roccof97](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roccof97/32/97628_2.png) [@Roccof97](https://discuss.elastic.co/u/Roccof97)\
**Post date:** [January 12, 2022, 8:45am UTC](https://discuss.elastic.co/t/how-to-enable-cache-in-logstash/294126/1 "2022-01-12T08:45:00Z")

</div>

Hello,

I currently have an elk cluster composed as follows:

Beats= is the agent installed in linux machine and send logs to Logstash  
Logstash= filter logs and send logs to elk

-Beats --\> Logstash --\> Elasticsearch

my thought is: "if elk stops due to a failure the logs that beats sends to logstash where do they go?"  
is it possible to enable a cache on logstash that in case the logs are not sent to elk for x reasons anyway he keeps them in a cache?

Thank you

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 13, 2022, 5:44am UTC](https://discuss.elastic.co/t/how-to-enable-cache-in-logstash/294126/2 "2022-01-13T05:44:24Z")

</div>

Take a look at [Queues and data resiliency | Logstash Reference [7.16] | Elastic](https://www.elastic.co/guide/en/logstash/current/resiliency.html)

---

<div class="post-metadata">

**Author:** ![Roccof97](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roccof97/32/97628_2.png) [@Roccof97](https://discuss.elastic.co/u/Roccof97)\
**Post date:** [January 13, 2022, 1:29pm UTC](https://discuss.elastic.co/t/how-to-enable-cache-in-logstash/294126/3 "2022-01-13T13:29:33Z")

</div>

thanks for your suggestion!

---

<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:** [February 10, 2022, 1:30pm UTC](https://discuss.elastic.co/t/how-to-enable-cache-in-logstash/294126/4 "2022-02-10T13:30:27Z")

</div>

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