# Logging which user creates and deletes indexes

**URL:** <https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352>\
**Category:** Elasticsearch\
**Created:** [June 24, 2020, 12:33am UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352 "2020-06-24T00:33:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebru](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@ebru](https://discuss.elastic.co/u/ebru)\
**Post date:** [June 24, 2020, 12:33am UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/1 "2020-06-24T00:33:12Z")

</div>

Hi, I am new to ElasticSearch and am trying to see if there is a way to see which user creates/deletes indexes. Currently I can see it in logs when an index is created or deleted, but can't see which user initiated these actions.

Security audit is currently enabled in my elasticsearch.yml

`xpack.security.audit.enabled: true`

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 24, 2020, 12:37am UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/2 "2020-06-24T00:37:07Z")

</div>

Welcome to our community! 😃

You do need audit logging enabled to track this.

---

<div class="post-metadata">

**Author:** ![ebru](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@ebru](https://discuss.elastic.co/u/ebru)\
**Post date:** [June 24, 2020, 3:18am UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/3 "2020-06-24T03:18:24Z")

</div>

> [@warkolm](#):
>
> udit logging e

Where can I enable this? I already have the`xpack.security.audit.enabled` flag set to true.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 24, 2020, 3:20am UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/4 "2020-06-24T03:20:59Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/enable-audit-logging.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/enable-audit-logging.html) goes into what needs to happen. So you need to make that change and then restart Elasticsearch.

---

<div class="post-metadata">

**Author:** ![ebru](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@ebru](https://discuss.elastic.co/u/ebru)\
**Post date:** [June 24, 2020, 3:35pm UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/5 "2020-06-24T15:35:15Z")

</div>

Mark, thank you for your response. I have already followed those steps.

Currently in my logs, I see the output as `[2020-06-24T10:00:00][INFO][o.e.c.m.MetaDataDeleteIndexService] [cluster_name] [index_name] deleting index`

However, I am trying to see how to add the name of the user that deleted the index to this output as well. My ES version is `6.7.1`. Thank you.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 24, 2020, 9:50pm UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/6 "2020-06-24T21:50:07Z")

</div>

What license level are you on?

---

<div class="post-metadata">

**Author:** ![ebru](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@ebru](https://discuss.elastic.co/u/ebru)\
**Post date:** [June 25, 2020, 2:46pm UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/7 "2020-06-25T14:46:11Z")

</div>

Platinum

---

<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:** [July 23, 2020, 2:46pm UTC](https://discuss.elastic.co/t/logging-which-user-creates-and-deletes-indexes/238352/8 "2020-07-23T14:46:12Z")

</div>

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