# Requirement to clear the index data and load fresh data

**URL:** <https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768>\
**Category:** Logstash\
**Created:** [February 21, 2018, 6:25am UTC](https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768 "2018-02-21T06:25:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranganath\_nangineni](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@ranganath\_nangineni](https://discuss.elastic.co/u/ranganath_nangineni)\
**Post date:** [February 21, 2018, 6:25am UTC](https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768/1 "2018-02-21T06:25:41Z")

</div>

I have a requirement to clear the existing index data and load the data into the same index whenever we run the logstash config.

How can we achieve this through the config file ?

---

<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 21, 2018, 6:27am UTC](https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768/2 "2018-02-21T06:27:49Z")

</div>

You are better off deleting the index and recreating it. That will need to be done externally.

Otherwise, create a new index and then use an alias to manage where it points to.

---

<div class="post-metadata">

**Author:** ![ranganath\_nangineni](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@ranganath\_nangineni](https://discuss.elastic.co/u/ranganath_nangineni)\
**Post date:** [February 21, 2018, 6:35am UTC](https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768/3 "2018-02-21T06:35:41Z")

</div>

Cant we have the " delete index " ([https://www.elastic.co/guide/en/elasticsearch/guide/current/\_deleting\_an\_index.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_deleting_an_index.html)) Api calls in the logstash config files?

---

<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 21, 2018, 6:39am UTC](https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768/4 "2018-02-21T06:39:00Z")

</div>

No, sorry.

---

<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:** [March 21, 2018, 6:39am UTC](https://discuss.elastic.co/t/requirement-to-clear-the-index-data-and-load-fresh-data/120768/5 "2018-03-21T06:39:55Z")

</div>

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