# How to deal with the window when logstash is down and logs may be lost

**URL:** <https://discuss.elastic.co/t/how-to-deal-with-the-window-when-logstash-is-down-and-logs-may-be-lost/67163>\
**Category:** Logstash\
**Created:** [November 25, 2016, 7:56am UTC](https://discuss.elastic.co/t/how-to-deal-with-the-window-when-logstash-is-down-and-logs-may-be-lost/67163 "2016-11-25T07:56:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangshuogr](https://avatars.discourse-cdn.com/v4/letter/w/41988e/32.png) [@wangshuogr](https://discuss.elastic.co/u/wangshuogr)\
**Post date:** [November 25, 2016, 7:56am UTC](https://discuss.elastic.co/t/how-to-deal-with-the-window-when-logstash-is-down-and-logs-may-be-lost/67163/1 "2016-11-25T07:56:21Z")

</div>

The situation is like this.  
I run a logstash docker to monitor the log file example.log and logstash consumes the logs to Elasticsearch.  
There is a rotation for log files. When the file is large enough it is archived and the application only keeps 10 archived files and deletes the rest.  
Now there might be a window when logstash is down and the unconsumed logs are archived even deleted. So we might lose those logs.  
Since logstash can not remove files after consuming them, I can only use log rotation.  
Is there some good way to solve this problem?

---

<div class="post-metadata">

**Author:** ![wangshuogr](https://avatars.discourse-cdn.com/v4/letter/w/41988e/32.png) [@wangshuogr](https://discuss.elastic.co/u/wangshuogr)\
**Post date:** [November 28, 2016, 2:55am UTC](https://discuss.elastic.co/t/how-to-deal-with-the-window-when-logstash-is-down-and-logs-may-be-lost/67163/2 "2016-11-28T02:55:37Z")

</div>

Is there someone who has better ideas?

---

<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:** [December 26, 2016, 2:55am UTC](https://discuss.elastic.co/t/how-to-deal-with-the-window-when-logstash-is-down-and-logs-may-be-lost/67163/3 "2016-12-26T02:55:49Z")

</div>

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