# Want to check check if Elastic search “read\_only\_allow\_delete” is true

**URL:** <https://discuss.elastic.co/t/want-to-check-check-if-elastic-search-read-only-allow-delete-is-true/251184>\
**Category:** Elasticsearch\
**Created:** [October 6, 2020, 7:45pm UTC](https://discuss.elastic.co/t/want-to-check-check-if-elastic-search-read-only-allow-delete-is-true/251184 "2020-10-06T19:45:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob35](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@bob35](https://discuss.elastic.co/u/bob35)\
**Post date:** [October 6, 2020, 7:45pm UTC](https://discuss.elastic.co/t/want-to-check-check-if-elastic-search-read-only-allow-delete-is-true/251184/1 "2020-10-06T19:45:52Z")

</div>

Elastic 6.8 I want to write something (Python) that check if the “read\_only\_allow\_delete” is true, and if it’s true to do something(notify) Is it possible to write something that run all the indices and check the status of “read\_only\_allow\_delete”?

Thanks !

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [October 7, 2020, 1:55am UTC](https://discuss.elastic.co/t/want-to-check-check-if-elastic-search-read-only-allow-delete-is-true/251184/2 "2020-10-07T01:55:59Z")

</div>

I found some old code from something I was testing, it's based on the [Python API](https://elasticsearch-py.readthedocs.io/en/master/)

Code:

```
indices = es.indices.get(index="*")
for k, v in sorted(indices.items()):
     if k == "_all":
          continue
     if k.startswith( "." ):
          continue
     print(k)
     pprint.pprint(v["aliases"])
     pprint.pprint(v["settings"])
     break

```

If I remember correctly, this gets a GET index/\_settings on all indices in the cluster. If v["settings"] ["index"]["blocks"] exists ["read\_only"] would be true.

Do a GET \_settings on your index with the block to verify the keys, this is from memory....

---

<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:** [November 4, 2020, 1:56am UTC](https://discuss.elastic.co/t/want-to-check-check-if-elastic-search-read-only-allow-delete-is-true/251184/3 "2020-11-04T01:56:06Z")

</div>

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