# Reading file from beginning using file input

**URL:** <https://discuss.elastic.co/t/reading-file-from-beginning-using-file-input/168253>\
**Category:** Logstash\
**Created:** [February 13, 2019, 3:51pm UTC](https://discuss.elastic.co/t/reading-file-from-beginning-using-file-input/168253 "2019-02-13T15:51:58Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [February 13, 2019, 4:45pm UTC](https://discuss.elastic.co/t/reading-file-from-beginning-using-file-input/168253/5 "2019-02-13T16:45:07Z")

</div>

If you delete a file and create a new one, then on some filesystems the inode number is re-used. That will prevent the file input from seeing it as a new file. For example

```
echo foo > foo ; ls -li foo ; rm foo 
echo foo > foo ; ls -li foo ; rm foo 

```

gets me

```
4272123 -rw-r--r--. 1 user user 4 Feb 13 11:41 foo
4272123 -rw-r--r--. 1 user user 4 Feb 13 11:41 foo

```

It re-uses inode 4272123. Ugh!

---

_[View the full topic](https://discuss.elastic.co/t/reading-file-from-beginning-using-file-input/168253)._
