# Deleting the data in Index before indexing the new data from input

**URL:** <https://discuss.elastic.co/t/deleting-the-data-in-index-before-indexing-the-new-data-from-input/183103>\
**Category:** Logstash\
**Created:** [May 28, 2019, 1:11pm UTC](https://discuss.elastic.co/t/deleting-the-data-in-index-before-indexing-the-new-data-from-input/183103 "2019-05-28T13:11:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjabiulla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sjabiulla/32/48429_2.png) [@sjabiulla](https://discuss.elastic.co/u/sjabiulla)\
**Post date:** [May 28, 2019, 1:11pm UTC](https://discuss.elastic.co/t/deleting-the-data-in-index-before-indexing-the-new-data-from-input/183103/1 "2019-05-28T13:11:38Z")

</div>

I have a batch monitoring log files which will keep logging the job status and I'm indexing that data from logs to ElasticSearch using FileBeats & Logstash.

Here is the data :

**Run 1:**  
job="job\_one" status="Not Started"  
job="job\_two" status="Not Started"  
job="job\_three" status="Not Started"

**Run 2:**  
job="job\_one" status="Started"  
job="job\_two" status="Started"  
job="job\_three" status="Started"

**Run 3:**  
job="job\_two" status="In Progress"  
job="job\_three" status="In Progress"

**Run 4:**  
job="job\_three" status="In Progress"

**Run 5:**  
\*_ **NOTHING** _

The challenge that I'm having here is, when I look at the latest run, If the job is not available which means that the job is completed. Ideally, If we have status as 'completed' in the log file, it would be easier to filter using that field. But now, since it's not available, How can I show pending jobs based on the latest run ?

---

<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:** [June 25, 2019, 1:11pm UTC](https://discuss.elastic.co/t/deleting-the-data-in-index-before-indexing-the-new-data-from-input/183103/2 "2019-06-25T13:11:41Z")

</div>

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