# Input file plugin - file is not read when modified

**URL:** <https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228>\
**Category:** Logstash\
**Created:** [September 19, 2020, 11:50pm UTC](https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228 "2020-09-19T23:50:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyz2](https://avatars.discourse-cdn.com/v4/letter/x/e480ec/32.png) [@xyz2](https://discuss.elastic.co/u/xyz2)\
**Post date:** [September 19, 2020, 11:50pm UTC](https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228/1 "2020-09-19T23:50:34Z")

</div>

HI,

I am using file input plugin in logstash. My file gets replaced in regular time interval . I need the file to be read from the beginning each time it is replaced.  
I have below setting . It reads from beginning only when the logstash is restarted. But after modification (added data in the beginning of file), it doesn't read it from the beginning.  
file {  
path =\> "/home/user1/test\_2020-09-\*.csv"  
sincedb\_path =\> "/dev/null"  
start\_position =\> "beginning"  
}

---

<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:** [September 20, 2020, 1:44am UTC](https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228/2 "2020-09-20T01:44:01Z")

</div>

Probably inode re-use. There are several github issues that discuss this. No simple solutions.

---

<div class="post-metadata">

**Author:** ![xyz2](https://avatars.discourse-cdn.com/v4/letter/x/e480ec/32.png) [@xyz2](https://discuss.elastic.co/u/xyz2)\
**Post date:** [September 20, 2020, 1:49am UTC](https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228/3 "2020-09-20T01:49:59Z")

</div>

It reads the file from bottom on updating the file. Assuming that probably it is considering the file not yet closed and that's why reads from bottom as per tail mode, I also tried setting the close\_older to a smaller interval (5 mins) and replaced the file after that.  
But no luck !

---

<div class="post-metadata">

**Author:** ![xyz2](https://avatars.discourse-cdn.com/v4/letter/x/e480ec/32.png) [@xyz2](https://discuss.elastic.co/u/xyz2)\
**Post date:** [September 20, 2020, 2:14am UTC](https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228/4 "2020-09-20T02:14:52Z")

</div>

Even after replacing the file after an hour, it didn't help.  
Does filebeat has this capability of reading the file from the beginning every time when it is replaced ?

---

<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:** [October 18, 2020, 2:14am UTC](https://discuss.elastic.co/t/input-file-plugin-file-is-not-read-when-modified/249228/5 "2020-10-18T02:14:59Z")

</div>

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