# File input not picking up copied or moved files

**URL:** https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245
**Category:** Logstash
**Created:** [August 12, 2015, 10:41am UTC](https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245 "2015-08-12T10:41:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![karolpivo](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@karolpivo](https://discuss.elastic.co/u/karolpivo)
#### Post date: [August 12, 2015, 10:41am UTC](https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245/1 "2015-08-12T10:41:55Z")

</div>

Hi,

I'm successfully using logstash to parse json formated events and send them to elasticsearch. Each event is created in a seprate file. One event per file with .json extension.

Logstash is correctly picking up a file when i create it using "vi mydoc.json", paste in the content and save. However it does not pick up if I cp or mv a file.

The objective is to automatically copy files to a directory and then parse them by logstash.  
Each file has a different name and size. I tried looking at logstash code to figure out what attribute it uses but couldnt find relevant code. I also tried deleting the .sincedb files but didn't help either.

The input config is as follows:

input {  
file {  
path =\> "/opt/rp/\*.json"  
type =\> "tp"  
start\_position =\> "beginning"  
stat\_interval =\> 1

```
  }

```

}

How can I have logstash pick up copied files? What file stat attribute does it use to check if a file is new?

Thanks

---

<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: [August 12, 2015, 10:45am UTC](https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245/2 "2015-08-12T10:45:26Z")

</div>

Logstash's file input (actually the Ruby filewatch library) tracks files via inode numbers. Copying or moving a file into a directory should make Logstash treat it as a new file unless there's inode reuse going on. You'll get additional debugging out if you start Logstash with `--verbose`.

---

<div class="post-metadata">

### Author: ![Rajeev\_Gaurav](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Rajeev\_Gaurav](https://discuss.elastic.co/u/Rajeev_Gaurav)
#### Post date: [March 30, 2016, 10:27am UTC](https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245/3 "2016-03-30T10:27:34Z")

</div>

Even I am facing the same issue where Log Stash is able to pickup the file which I created there but unable to pick up the files which is there by either copying or Moving or from Downloading.

Suggest some points.

---

<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: [March 30, 2016, 11:20am UTC](https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245/4 "2016-03-30T11:20:25Z")

</div>

Perhaps the files are old than 24 hours and you haven't adjusted the file input's `ignore_older` option. Otherwise the previously given advice of using the `--verbose` option is still relevant.

---

<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:04am UTC](https://discuss.elastic.co/t/file-input-not-picking-up-copied-or-moved-files/27245/5 "2017-07-06T05:04:46Z")

</div>


