# Backfill with previous indexed data

**URL:** <https://discuss.elastic.co/t/backfill-with-previous-indexed-data/329321>\
**Category:** Logstash\
**Created:** [April 4, 2023, 12:58pm UTC](https://discuss.elastic.co/t/backfill-with-previous-indexed-data/329321 "2023-04-04T12:58:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suminlim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suminlim/32/97487_2.png) [@suminlim](https://discuss.elastic.co/u/suminlim)\
**Post date:** [April 4, 2023, 12:58pm UTC](https://discuss.elastic.co/t/backfill-with-previous-indexed-data/329321/1 "2023-04-04T12:58:28Z")

</div>

![problem01](https://us1.discourse-cdn.com/elastic/original/3X/0/1/01c8e5079fc6f6e1eafee04d8f858029a71f1e46.png)

using logstash, is it available ?

```auto
input {
  elasticsearch {
    hosts => "localhost"
    index => "logs"
    query => '{ "sort": ["timeinfo"] }'
  }
}
filter {
 if [location] == "" {
   // how to get previous data in here?
  }
}

```

---

<div class="post-metadata">

**Author:** ![suminlim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suminlim/32/97487_2.png) [@suminlim](https://discuss.elastic.co/u/suminlim)\
**Post date:** [April 7, 2023, 3:02am UTC](https://discuss.elastic.co/t/backfill-with-previous-indexed-data/329321/2 "2023-04-07T03:02:23Z")

</div>

I resolved this issue with Aggregate filter.

> **[Aggregate filter plugin | Logstash Reference \[8.7\] | Elastic](https://www.elastic.co/guide/en/logstash/8.7/plugins-filters-aggregate.html)**

---

<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:** [May 5, 2023, 3:02am UTC](https://discuss.elastic.co/t/backfill-with-previous-indexed-data/329321/3 "2023-05-05T03:02:27Z")

</div>

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