# Force flush before shutdown

**URL:** https://discuss.elastic.co/t/force-flush-before-shutdown/23931
**Category:** Logstash
**Created:** [June 18, 2015, 4:56pm UTC](https://discuss.elastic.co/t/force-flush-before-shutdown/23931 "2015-06-18T16:56:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kelvinfann](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelvinfann](https://discuss.elastic.co/u/kelvinfann)
#### Post date: [June 18, 2015, 4:56pm UTC](https://discuss.elastic.co/t/force-flush-before-shutdown/23931/1 "2015-06-18T16:56:18Z")

</div>

Hi, I have been trying to write an interval metric counter for logstash and I was wondering if it was possible to force logstash to flush a message before shutdown so that if I restarted the logstash, it would not lose any message count or data.

---

<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 6, 2017, 5:37am UTC](https://discuss.elastic.co/t/force-flush-before-shutdown/23931/2 "2017-07-06T05:37:06Z")

</div>


