# File input monitoring a file or folder always reads from beginning

**URL:** https://discuss.elastic.co/t/file-input-monitoring-a-file-or-folder-always-reads-from-beginning/49002
**Category:** Logstash
**Created:** [May 2, 2016, 10:03pm UTC](https://discuss.elastic.co/t/file-input-monitoring-a-file-or-folder-always-reads-from-beginning/49002 "2016-05-02T22:03:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gsgokul](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@gsgokul](https://discuss.elastic.co/u/gsgokul)
#### Post date: [May 2, 2016, 10:03pm UTC](https://discuss.elastic.co/t/file-input-monitoring-a-file-or-folder-always-reads-from-beginning/49002/1 "2016-05-02T22:03:11Z")

</div>

I have a config that reads a folder in linux, issue is logstash always reads from beginning for each modification, After first successful run I add a log entry to the file, logstash reads from beginning instead of reading only the last entry. I removed sincedb files no luck, any help is appreciated

input {  
file {  
path =\> "/home/gsgokul/working/logs/\*"  
start\_position =\> "beginning"  
}  
}  
filter {  
grok {  
patterns\_dir =\> ["/home/gsgokul/working/patterns"]  
match =\> { "message" =\> "%{IDENTIFI\_LOG}"}  
}  
date {  
match =\> ["logdate", "YYYY-MM-dd HH:mm:ss,SSS"]  
target =\> "@timestamp"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
}  
stdout { codec =\> rubydebug }  
}

---

<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: [May 8, 2016, 8:11pm UTC](https://discuss.elastic.co/t/file-input-monitoring-a-file-or-folder-always-reads-from-beginning/49002/2 "2016-05-08T20:11:55Z")

</div>

It seems like sincedb isn't working for you. If you start Logstash with `--verbose` it'll tell you more about what happens, like which sincedb file is used and what offset is read from it.

---

<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, 4:58am UTC](https://discuss.elastic.co/t/file-input-monitoring-a-file-or-folder-always-reads-from-beginning/49002/4 "2017-07-06T04:58:40Z")

</div>


