# Log-stash does not trigger new copied files

**URL:** <https://discuss.elastic.co/t/log-stash-does-not-trigger-new-copied-files/110872>\
**Category:** Logstash\
**Created:** [December 8, 2017, 3:53pm UTC](https://discuss.elastic.co/t/log-stash-does-not-trigger-new-copied-files/110872 "2017-12-08T15:53:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maysam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maysam/32/25211_2.png) [@Maysam](https://discuss.elastic.co/u/Maysam)\
**Post date:** [December 8, 2017, 3:53pm UTC](https://discuss.elastic.co/t/log-stash-does-not-trigger-new-copied-files/110872/1 "2017-12-08T15:53:36Z")

</div>

Hello I have a box that receives files in a target folder .  
I have the following config:  
input {

```
 file {
    path => ["/usr/local/ogr/target/*/*Group.json"]
    codec => json
    start_position => "beginning"
 }

}

output {
    elasticsearch {
        hosts => ["localhost:9200"]
        index => "groups"
    }

    stdout {}
}

```

Log-stash does not read the files by this config, However when i edit the file (adding a space), it triggers the file and process it.  
How can I configure log-stash to read all the files as they move to my server (as they copied to that directory...)

---

<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 11, 2017, 6:35am UTC](https://discuss.elastic.co/t/log-stash-does-not-trigger-new-copied-files/110872/2 "2017-12-11T06:35:36Z")

</div>

Logstash probably think it already has processed the files (it probably did while you were trying things out). Deleting the sincedb file should help. See the file input documentation.

---

<div class="post-metadata">

**Author:** ![Maysam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maysam/32/25211_2.png) [@Maysam](https://discuss.elastic.co/u/Maysam)\
**Post date:** [December 18, 2017, 4:10pm UTC](https://discuss.elastic.co/t/log-stash-does-not-trigger-new-copied-files/110872/3 "2017-12-18T16:10:04Z")

</div>

Thanks @magnusbaeck ,

I end up creating a bash file to add an empty line to the end of each file every 5 minutes, that makes the log-stash see a change in a file and triggers them.

`*/5 * * * * sed -i -e '$a\' /usr/local/ogr/target/*/*/*Group.json`

---

<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:** [January 15, 2018, 4:10pm UTC](https://discuss.elastic.co/t/log-stash-does-not-trigger-new-copied-files/110872/4 "2018-01-15T16:10:17Z")

</div>

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