# How to exclude empty (0 KB) files in logstash

**URL:** <https://discuss.elastic.co/t/how-to-exclude-empty-0-kb-files-in-logstash/48648>\
**Category:** Logstash\
**Created:** [April 28, 2016, 8:45am UTC](https://discuss.elastic.co/t/how-to-exclude-empty-0-kb-files-in-logstash/48648 "2016-04-28T08:45:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![baneshbanna](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@baneshbanna](https://discuss.elastic.co/u/baneshbanna)\
**Post date:** [April 28, 2016, 8:45am UTC](https://discuss.elastic.co/t/how-to-exclude-empty-0-kb-files-in-logstash/48648/1 "2016-04-28T08:45:01Z")

</div>

Frequently logstash crashed with the following error  
{:timestamp=\>"2016-04-28T12:49:47.540000+0530", :message=\>"A plugin had an unrecoverable error. Will restart this plugin.\n Plugin: \<LogStash::Inputs::File path=\>["filepath"], start\_position=\>"beginning", type=\>"type", delimiter=\>"\u0019", close\_older=\>300, max\_open\_files=\>5000, discover\_interval=\>5, ignore\_older=\>172800, sincedb\_path=\>"/apps/sincedb/QA\_TRANS\_TIME\_TAKEN/tsaction.log", codec=\>\<LogStash::Codecs::Plain charset=\>"UTF-8"\>, stat\_interval=\>1, sincedb\_write\_interval=\>15\>\n Error: No such file or directory - /apps/qa\_logdata/mlogserverj/logs\_primary/\_\_302007\_\_\_611926289499029.log", :level=\>:error}

My application generating file every 2 seconds if file size is 0 kb deleting those files.  
Its blocker for me .Please suggest How to exclude 0KB files in logstash.  
Thanks in advance.

---

<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:00am UTC](https://discuss.elastic.co/t/how-to-exclude-empty-0-kb-files-in-logstash/48648/2 "2017-07-06T05:00:11Z")

</div>


