# Check health of write index of alias?

**URL:** <https://discuss.elastic.co/t/check-health-of-write-index-of-alias/364267>\
**Category:** Elasticsearch\
**Created:** [August 2, 2024, 10:17am UTC](https://discuss.elastic.co/t/check-health-of-write-index-of-alias/364267 "2024-08-02T10:17:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nisow95612](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nisow95612](https://discuss.elastic.co/u/nisow95612)\
**Post date:** [August 2, 2024, 10:17am UTC](https://discuss.elastic.co/t/check-health-of-write-index-of-alias/364267/1 "2024-08-02T10:17:31Z")

</div>

Both data streams and [Tutorial: Automate rollover with ILM | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/getting-started-index-lifecycle-management.html#manage-time-series-data-without-data-streams) keep old index in alias on rollover. I want check by API my aliases are good for write (meaning health is green or yellow), but because rollover keeps old index in alias, some old cold index can go red and I get alias status red.

Is there way how I can ask about status of only write alias?  
Or way ILM can remove previous index from alias after rollover?

Thank you!

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [August 2, 2024, 12:12pm UTC](https://discuss.elastic.co/t/check-health-of-write-index-of-alias/364267/2 "2024-08-02T12:12:47Z")

</div>

Hi @nisow95612 ,

I'm not sure if I understood correctly, but if you run the command below, you will get the answer about the aliases. For example:

`GET /_alias/my_alias`

result:

```auto
{
  "my_index-000001": {
    "aliases": {
      "my_alias": {
        "is_write_index": false
      }
    }
  },
  "my_index-000002": {
    "aliases": {
      "my_alias": {
        "is_write_index": true
      }
    }
  }
}

```

Would you like to filter the results to show only my\_index-000002?

---

<div class="post-metadata">

**Author:** ![nisow95612](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nisow95612](https://discuss.elastic.co/u/nisow95612)\
**Post date:** [August 2, 2024, 1:27pm UTC](https://discuss.elastic.co/t/check-health-of-write-index-of-alias/364267/3 "2024-08-02T13:27:20Z")

</div>

Yes, I can ask all aliases like this, filter for all write index and then ask all that write index for index health. Lot of work and race condion problem.

Monitoring all write indexes is important because if they go red, no new logs can go in.  
But monitoring all older indexes is not important. If they go red, compliance is fine.

Here is how I solve it now:  
External alias manager, keeps only write index in alias, removes other.  
`GET /_cat/indices/*_write?format=json&h=index,health&master_timeout=5s`  
If that show red or yellow anywhere then its an alarm.

But this tool refused 8.0 support so I want switch to ILM for rollover, but this creates problem - command would monitor older indexes and cause false alarms.
