# File input not working on OSX

**URL:** <https://discuss.elastic.co/t/file-input-not-working-on-osx/37470>\
**Category:** Logstash\
**Created:** [December 17, 2015, 1:03pm UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470 "2015-12-17T13:03:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmorgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schmorgs/32/39476_2.png) [@schmorgs](https://discuss.elastic.co/u/schmorgs)\
**Post date:** [December 17, 2015, 1:03pm UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470/1 "2015-12-17T13:03:35Z")

</div>

I'm using the file input on my mac, and every time I update the file, it's replaying all messages from the beginning of the log.

I've tried explicitly setting the sincedb\_path and start\_position vars, but no luck.

.sincedb is created, but I noticed the inode didn't match the file I was updating.

On further investigation, (and I could be wrong), it looks like OSX changes the inode every time the file is updated, not just when a new file is created.

I assume this is the reason it resends all as Logstash thinks it's a new file, but wondering if anyone else has seen this, and/or has a workaround.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 17, 2015, 3:38pm UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470/2 "2015-12-17T15:38:36Z")

</div>

Indeed, it sounds like the file is rewritten in a new file. Logstash assumes that log files are appended to. What program is updating the file and is this an actual use case or just you testing?

---

<div class="post-metadata">

**Author:** ![schmorgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schmorgs/32/39476_2.png) [@schmorgs](https://discuss.elastic.co/u/schmorgs)\
**Post date:** [January 11, 2016, 11:40am UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470/3 "2016-01-11T11:40:36Z")

</div>

Hi, it's just me testing, so using vi to add a new line to the file.

We don't use Mac's in production 🙂 so it's not a big issue, but it's nicer to do my development on a Mac so would be good if it could be resolved.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 11, 2016, 11:52am UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470/4 "2016-01-11T11:52:07Z")

</div>

vi probably creates a new file and renaming it to replace the original file, thus resulting in a new inode for the file every time. Make sure you append to the file instead, e.g. with `echo "test log message" >> logfile.log`.

---

<div class="post-metadata">

**Author:** ![schmorgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schmorgs/32/39476_2.png) [@schmorgs](https://discuss.elastic.co/u/schmorgs)\
**Post date:** [January 15, 2016, 1:42pm UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470/5 "2016-01-15T13:42:49Z")

</div>

Good point, didn't even occur to me that might be the issue - thanks for pointer.

---

<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:15am UTC](https://discuss.elastic.co/t/file-input-not-working-on-osx/37470/6 "2017-07-06T05:15:36Z")

</div>

Closed on July 6, 2017, 5:15am UTC


