# Unable to filter older indices

**URL:** https://discuss.elastic.co/t/unable-to-filter-older-indices/343359
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [September 19, 2023, 12:16pm UTC](https://discuss.elastic.co/t/unable-to-filter-older-indices/343359 "2023-09-19T12:16:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pbmamatha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pbmamatha/32/125800_2.png) [@pbmamatha](https://discuss.elastic.co/u/pbmamatha)
#### Post date: [September 19, 2023, 12:16pm UTC](https://discuss.elastic.co/t/unable-to-filter-older-indices/343359/1 "2023-09-19T12:16:04Z")

</div>

Hello,

I am tasked to create an alert for indices older than 3 days, however, the filter query is not working. Could you please help me identify the issue.

Have tried the below queries:

```auto

1. GET /_search
{
    "query": {
        "bool": {
            "filter": [
                {
                    "range": {
                        "@timestamp": {
                            "lt": "now-3d"
                            //"l": "now"
                        }
                    }
                }
            ]
        }
    }
 
}

2. GET /_cat/indices?v&filter_path=creation.date:<now-3d&h=uuid,creation.date.string&s=creation.date:desc

3. GET _cat/indices?v&s=index&h=uuid,creation.date | awk '$2 < "now-3d" {print $1}'

```

Please help!

---

<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: [October 17, 2023, 12:16pm UTC](https://discuss.elastic.co/t/unable-to-filter-older-indices/343359/2 "2023-10-17T12:16:37Z")

</div>

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