# After convert csv to ES anyway to update index without change its name

**URL:** <https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481>\
**Category:** Logstash\
**Created:** [February 23, 2016, 10:19am UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481 "2016-02-23T10:19:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neal\_Shan](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@Neal\_Shan](https://discuss.elastic.co/u/Neal_Shan)\
**Post date:** [February 23, 2016, 10:19am UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/1 "2016-02-23T10:19:45Z")

</div>

Scenario

1. use logstash transfer csv to elasticsearch
2. csv update every week, have to create a new index for it, and index name will be changed, otherwise, the index will have old and new data in it, we only need the lastest cs's data

any way to clean up data from index before logstash input data to ES  
My solution:

1. remove the node
2. use logstash to transfer csv to ES

any way to config it in logstash?

---

<div class="post-metadata">

**Author:** ![Kryten](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@Kryten](https://discuss.elastic.co/u/Kryten)\
**Post date:** [February 23, 2016, 6:25pm UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/2 "2016-02-23T18:25:57Z")

</div>

I'm not aware of any Logstash based way to do this, though would happily be corrected.  
Sounds more like a job for the ES curator.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 23, 2016, 6:31pm UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/3 "2016-02-23T18:31:37Z")

</div>

Just use an index per week, then [Elasticsearch Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html) to manage deletion as mentioned by @Kryten.

---

<div class="post-metadata">

**Author:** ![Neal\_Shan](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@Neal\_Shan](https://discuss.elastic.co/u/Neal_Shan)\
**Post date:** [February 24, 2016, 3:03am UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/4 "2016-02-24T03:03:23Z")

</div>

Thanks, that make sense. any idea to run it as a cronjob?

---

<div class="post-metadata">

**Author:** ![Neal\_Shan](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@Neal\_Shan](https://discuss.elastic.co/u/Neal_Shan)\
**Post date:** [February 24, 2016, 3:04am UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/5 "2016-02-24T03:04:14Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![Neal\_Shan](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@Neal\_Shan](https://discuss.elastic.co/u/Neal_Shan)\
**Post date:** [February 24, 2016, 3:11am UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/6 "2016-02-24T03:11:00Z")

</div>

Thanks Guys,  
I might need a shell script more than this, we want it automatically.  
because I need to 1. remove indice 2. import data per week.

If there is a ES tools to start a cronjob, please let me know, thanks in advance.  
@Kryten @warkolm

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 24, 2016, 6:32pm UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/7 "2016-02-24T18:32:11Z")

</div>

No, you need to use cron.

---

<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:09am UTC](https://discuss.elastic.co/t/after-convert-csv-to-es-anyway-to-update-index-without-change-its-name/42481/8 "2017-07-06T05:09:52Z")

</div>


