# How to know when indices mapping was updated

**URL:** https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046
**Category:** Elasticsearch
**Created:** [October 15, 2023, 11:12am UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046 "2023-10-15T11:12:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![pratik\_jain163](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratik_jain163/32/93354_2.png) [@pratik\_jain163](https://discuss.elastic.co/u/pratik_jain163)
#### Post date: [October 15, 2023, 11:12am UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/1 "2023-10-15T11:12:14Z")

</div>

hi All,

Someone has updated the mapping of any indices, so I want to know how we can find this.  
And also, is there a way we can get all indices to also get udpated.  
and if we want to enable auditing in ES how we can do.

---

<div class="post-metadata">

### Author: ![iulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iulia/32/124658_2.png) [@iulia](https://discuss.elastic.co/u/iulia)
#### Post date: [October 16, 2023, 9:38am UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/2 "2023-10-16T09:38:02Z")

</div>

Hi!  
When you create a new mapping and then reindex your index to the new mapping, you can add the parameter `wait_for_completion=False` which will create a task ID for you to keep track of the process with.

> **[Reindex API | Elasticsearch Guide \[8.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-task-api)**

Then you can use the tasks API to search through these tasks and see when a reindex task has been completed by searching with the ID, or even searching for all tasks of that kind.

> **[Task management API | Elasticsearch Guide \[8.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_wait_for_completion)**

It is also recommended to use the reindex API if you want to reindex multiple indeces, one by one. ( [Reindex API | Elasticsearch Guide [8.10] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-from-multiple-sources))

---

<div class="post-metadata">

### Author: ![pratik\_jain163](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratik_jain163/32/93354_2.png) [@pratik\_jain163](https://discuss.elastic.co/u/pratik_jain163)
#### Post date: [October 16, 2023, 10:26am UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/3 "2023-10-16T10:26:24Z")

</div>

Thanks for the reply, but I want to know when indices or mapping are updated.  
For auditing purposes, I am asking.  
if a task is present it will impact performance and without task how we can get.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [October 16, 2023, 12:04pm UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/4 "2023-10-16T12:04:56Z")

</div>

> [@pratik\_jain163](#):
>
> Someone has updated the mapping of any indices, so I want to know how we can find this.  
> And also, is there a way we can get all indices to also get udpated.  
> and if we want to enable auditing in ES how we can do.

You would need to have audit logs enabled, audit logs are available if you have a paid license.

Without audit logs you cannot know who updated anything.

---

<div class="post-metadata">

### Author: ![Sunile\_Manjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunile_manjee/32/111461_2.png) [@Sunile\_Manjee](https://discuss.elastic.co/u/Sunile_Manjee)
#### Post date: [October 16, 2023, 5:22pm UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/5 "2023-10-16T17:22:49Z")

</div>

> [@leandrojmp](#):
>
> Without audit logs you cannot know who updated anything

I thought about this approach and resisted responding to the question. From what I can tell (based on research), the audit events do not specifically include when a mapping is updated based on events captured: [Audit events | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/audit-event-types.html)

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [October 16, 2023, 5:40pm UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/6 "2023-10-16T17:40:36Z")

</div>

Hi everyone let me clarify a bit

1. As @leandrojmp mentioned auditing requires a commercial license
2. As @Sunile_Manjee mentioned updates to mappings is not one of the simple events that is easily auditable
3. You can do it by [enabling REST logging](https://www.elastic.co/guide/en/elasticsearch/reference/current/audit-event-types.html#_audit_event_attributes_of_the_rest_event_type) audit logging and capturing the body of these REST events and then filtering and search on them. **THIS can generate a large volume of data. And is usually a method of last resort.**

In general, the more preferred approach is to apply Role Based Control on your non-admin users on the index privileges

> **[Security privileges | Elasticsearch Guide \[8.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html)**

---

<div class="post-metadata">

### Author: ![pratik\_jain163](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratik_jain163/32/93354_2.png) [@pratik\_jain163](https://discuss.elastic.co/u/pratik_jain163)
#### Post date: [October 18, 2023, 7:58am UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/7 "2023-10-18T07:58:17Z")

</div>

> [@leandrojmp](#):
>
> Without audit logs you cannot know who updated anything.

thanks for the reply but enabling REST will create huge data and it can impact performance correct.

i think we should get some feature that will add some additional fields in index such as last\_update time something like that.

---

<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 15, 2023, 7:58am UTC](https://discuss.elastic.co/t/how-to-know-when-indices-mapping-was-updated/345046/8 "2023-11-15T07:58:48Z")

</div>

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