# How To Make File Input Read Entire File Every Time?

**URL:** <https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278>\
**Category:** Logstash\
**Created:** [August 29, 2015, 8:25am UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278 "2015-08-29T08:25:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TramsWang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tramswang/32/4473_2.png) [@TramsWang](https://discuss.elastic.co/u/TramsWang)\
**Post date:** [August 29, 2015, 8:25am UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278/1 "2015-08-29T08:25:14Z")

</div>

Hello everyone. I'm now learning to use logstash. And I want to practice a little on the "file" plugin in the input stage. However as the tutorial says, it will ignore the shipped content in an old file that had already been read and only catch the new appended lines. When logstash finds that the file has been read before, the "start\_position" property in the "file" plugin goes no effect. How can I disable this feature and enable it later on?  
Thanks a lot 😄

---

<div class="post-metadata">

**Author:** ![Joshua\_Rich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshua_rich/32/44953_2.png) [@Joshua\_Rich](https://discuss.elastic.co/u/Joshua_Rich)\
**Post date:** [August 29, 2015, 9:00am UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278/2 "2015-08-29T09:00:41Z")

</div>

You can set the following two parameters in your `file` input:

```auto
sincedb_path => "/dev/null"
start_position => "beginning"

```

The first sets the `sincedb_path` file to /dev/null, which means that logstash won't be able to save the place it was up to in the file between runs. The second sets the `start_postion` to the beginning of the file, so it will always read from the start of the file.

---

<div class="post-metadata">

**Author:** ![TramsWang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tramswang/32/4473_2.png) [@TramsWang](https://discuss.elastic.co/u/TramsWang)\
**Post date:** [August 29, 2015, 11:17am UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278/3 "2015-08-29T11:17:01Z")

</div>

Thanks a lot! It's very helpful! 😀

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 29, 2015, 10:22pm UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278/4 "2015-08-29T22:22:43Z")

</div>

If you're just testing/learning, using the stdin input along with `cat file | logstash....` is easier 🙂

---

<div class="post-metadata">

**Author:** ![TramsWang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tramswang/32/4473_2.png) [@TramsWang](https://discuss.elastic.co/u/TramsWang)\
**Post date:** [August 30, 2015, 1:26am UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278/5 "2015-08-30T01:26:10Z")

</div>

yeah~It's really an easy way 😁

---

<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:30am UTC](https://discuss.elastic.co/t/how-to-make-file-input-read-entire-file-every-time/28278/6 "2017-07-06T05:30:38Z")

</div>


