# Logstash 6.8 Input File not using exit\_after\_read

**URL:** <https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420>\
**Category:** Logstash\
**Created:** [April 3, 2020, 3:05pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420 "2020-04-03T15:05:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 3, 2020, 3:05pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/1 "2020-04-03T15:05:00Z")

</div>

Working with a client that has ELK 6.8.1 Their system produces a JSON file every minute (obviously a lot of files). I've been successful getting them into ES but having an issue with the number open. I'd like it to close the file, but the 'exit\_after\_read' keeps giving me an error.

Here is my config:  
'  
input {  
file {  
path =\> "/apps/home/reportuser/test/test\_json/_/_.json"  
start\_position =\> "beginning"  
sincedb\_path =\> "/home/reportuser/test/sincedb/test\_json.log"  
exit\_after\_read =\> true  
}  
}

filter {

}  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "test\_json"  
}  
}'

When I run Logstash in ' --config.test\_and\_exit' mode it tells me 'exit\_after\_read' is invalid but the 6.8.1 docs say otherwise:

[2020-04-03T14:52:18,430][ERROR][logstash.inputs.file] Unknown setting 'exit\_after\_read' for file  
[2020-04-03T14:52:18,447][FATAL][logstash.runner] The given configuration is invalid. Reason: Something is wrong with your configuration.

[https://www.elastic.co/guide/en/logstash/6.8/plugins-inputs-file.html](https://www.elastic.co/guide/en/logstash/6.8/plugins-inputs-file.html)

Any help appreciated...

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 3, 2020, 3:48pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/2 "2020-04-03T15:48:50Z")

</div>

> [@seibelj](#):
>
> [logstash.inputs.file] Unknown setting 'exit\_after\_read' for file

Support for exit\_after\_read was [merged](https://github.com/logstash-plugins/logstash-input-file/pull/240) into the 'master' branch 6 weeks ago. I don't see any indication there was a backport into older versions. If it only went into master I am not sure it will be in any currently available release.

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 3, 2020, 4:05pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/3 "2020-04-03T16:05:45Z")

</div>

Well rats. So they would have to update to the current version to get that functionality is what I am hearing? I guess the documentation is incorrect (no blame here).

Can you think of another way to handle this?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 3, 2020, 4:25pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/4 "2020-04-03T16:25:15Z")

</div>

> [@seibelj](#):
>
> Can you think of another way to handle this?

Does reducing close\_after help?

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 3, 2020, 4:34pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/5 "2020-04-03T16:34:24Z")

</div>

I think you mean 'close\_older'? I'm going to look at it now

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 3, 2020, 4:51pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/6 "2020-04-03T16:51:44Z")

</div>

that worked! Thank you!

---

<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:** [May 1, 2020, 4:51pm UTC](https://discuss.elastic.co/t/logstash-6-8-input-file-not-using-exit-after-read/226420/7 "2020-05-01T16:51:47Z")

</div>

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