# How to update data automatically in elastic search when we deleted files in log stash input path

**URL:** <https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600>\
**Category:** Elasticsearch\
**Created:** [June 20, 2019, 6:31am UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600 "2019-06-20T06:31:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshavardhan\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshavardhan_reddy/32/48409_2.png) [@Harshavardhan\_Reddy](https://discuss.elastic.co/u/Harshavardhan_Reddy)\
**Post date:** [June 20, 2019, 6:31am UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600/1 "2019-06-20T06:31:34Z")

</div>

i uploaded source files into elastic search by log stash. whenever new file is added in source path (input) it automatically reflecting in elastic search index . but if any files we deleted in source path , it showing same like previous . that deleted file result also showing in elastic search index.

source : /input having 2 csv files on time T1 then these 2 files are pushed into elastic search index .

then at , T2 i deleted a single csv file from source /input , but it will showing 2 csv result in elastic search index .

so , how to make reflection of update data in elastic search when any files were deleted in source path .

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 29, 2019, 5:19pm UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600/2 "2019-06-29T17:19:06Z")

</div>

Logstash is designed to stream log files, not sync files in a directory structure with Elasticsearch. If you want to handle deleted files I suspect you may need to create a custom solution.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 29, 2019, 7:04pm UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600/3 "2019-06-29T19:04:04Z")

</div>

I think that FSCrawler might be able to handle this. Not sure though.

---

<div class="post-metadata">

**Author:** ![Harshavardhan\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshavardhan_reddy/32/48409_2.png) [@Harshavardhan\_Reddy](https://discuss.elastic.co/u/Harshavardhan_Reddy)\
**Post date:** [July 4, 2019, 7:18am UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600/4 "2019-07-04T07:18:03Z")

</div>

thank you @ christian

---

<div class="post-metadata">

**Author:** ![Harshavardhan\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshavardhan_reddy/32/48409_2.png) [@Harshavardhan\_Reddy](https://discuss.elastic.co/u/Harshavardhan_Reddy)\
**Post date:** [July 4, 2019, 7:18am UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600/5 "2019-07-04T07:18:41Z")

</div>

Thank you @dadoonet

---

<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:** [August 1, 2019, 7:18am UTC](https://discuss.elastic.co/t/how-to-update-data-automatically-in-elastic-search-when-we-deleted-files-in-log-stash-input-path/186600/6 "2019-08-01T07:18:41Z")

</div>

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