# How to gracefully exit a scheduled Logstash Output

**URL:** <https://discuss.elastic.co/t/how-to-gracefully-exit-a-scheduled-logstash-output/47485>\
**Category:** Logstash\
**Created:** [April 15, 2016, 8:49am UTC](https://discuss.elastic.co/t/how-to-gracefully-exit-a-scheduled-logstash-output/47485 "2016-04-15T08:49:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrgns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jrgns/32/640_2.png) [@jrgns](https://discuss.elastic.co/u/jrgns)\
**Post date:** [April 15, 2016, 8:49am UTC](https://discuss.elastic.co/t/how-to-gracefully-exit-a-scheduled-logstash-output/47485/1 "2016-04-15T08:49:11Z")

</div>

I feel I need to know this, but I don't ☹

The Cloudwatch Logstash output doesn't exit when Logstash gets a kill signal (Ctrl+C), causing Logstash to eventually kill the process. If there's still metrics in the buffer when this happens, they won't get sent to AWS.

The input plugin has a `stop` method that you can override if anything special needs to be done to exit from the run method. It doesn't look like the output plugin has a similiar method? Or am I just missing something?

For reference: [https://github.com/logstash-plugins/logstash-output-cloudwatch/issues/9](https://github.com/logstash-plugins/logstash-output-cloudwatch/issues/9)

---

<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:02am UTC](https://discuss.elastic.co/t/how-to-gracefully-exit-a-scheduled-logstash-output/47485/2 "2017-07-06T05:02:05Z")

</div>


