# Shutdown hooks for output codecs

**URL:** <https://discuss.elastic.co/t/shutdown-hooks-for-output-codecs/46333>\
**Category:** Logstash\
**Created:** [April 5, 2016, 7:14am UTC](https://discuss.elastic.co/t/shutdown-hooks-for-output-codecs/46333 "2016-04-05T07:14:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![garyL](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@garyL](https://discuss.elastic.co/u/garyL)\
**Post date:** [April 5, 2016, 7:14am UTC](https://discuss.elastic.co/t/shutdown-hooks-for-output-codecs/46333/1 "2016-04-05T07:14:49Z")

</div>

I'm trying to write a batching codec, and need to flush the batch on shutdown. I've implemented the close method but that does no appear to get called. From what I can see of the pipeline code this only gets called on input. Is there a way to implement shut down code on an output codec.

---

<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:03am UTC](https://discuss.elastic.co/t/shutdown-hooks-for-output-codecs/46333/2 "2017-07-06T05:03:55Z")

</div>

Closed on July 6, 2017, 5:03am UTC


