# Truncate/delete the entire index once new data arrives from Logstash

**URL:** <https://discuss.elastic.co/t/truncate-delete-the-entire-index-once-new-data-arrives-from-logstash/181163>\
**Category:** Elasticsearch\
**Created:** [May 15, 2019, 11:21am UTC](https://discuss.elastic.co/t/truncate-delete-the-entire-index-once-new-data-arrives-from-logstash/181163 "2019-05-15T11:21:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [May 16, 2019, 9:49pm UTC](https://discuss.elastic.co/t/truncate-delete-the-entire-index-once-new-data-arrives-from-logstash/181163/3 "2019-05-16T21:49:22Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

> [@saif3r](#):
>
> Hi Guys,

We are not all guys fortunately. I think that `Hi!` is perfectly enough 🙂

> [@saif3r](#):
>
> Is that achievable in an automatic manner?

Not really. You can consider different options:

Use a technical temporary table of deleted items. Read that table and delete every document which is referenced in it.  
Use a trigger  
Modify the application layer (the service layer) and do that in real time. That's my preferred way.

I shared most of my thoughts there: [https://david.pilato.fr/blog/2015-05-09-advanced-search-for-your-legacy-application/](http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/)

---

_[View the full topic](https://discuss.elastic.co/t/truncate-delete-the-entire-index-once-new-data-arrives-from-logstash/181163)._
