# Append username in the slowlog in Elasticsearch 2.4.1?

**URL:** <https://discuss.elastic.co/t/append-username-in-the-slowlog-in-elasticsearch-2-4-1/83674>\
**Category:** Elasticsearch\
**Created:** [April 26, 2017, 10:12am UTC](https://discuss.elastic.co/t/append-username-in-the-slowlog-in-elasticsearch-2-4-1/83674 "2017-04-26T10:12:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [April 26, 2017, 10:12am UTC](https://discuss.elastic.co/t/append-username-in-the-slowlog-in-elasticsearch-2-4-1/83674/1 "2017-04-26T10:12:47Z")

</div>

Hi,

Question 1:

I need to know the name of the user who is sending the queries to my elasticsearch Cluster ? Is it possible?

Usual format:

`[2017-01-13 12:58:09,843][WARN][index.search.slowlog.query] [Spectra] [testindex-stats][2] took[15.3ms], took_millis[15], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{"query":{"match":{"text":"ronin"}}}], extra_source[],`

Expectation:

`[2017-01-13 12:58:09,843][username][WARN][index.search.slowlog.query] [Spectra] [testindex-stats][2] took[15.3ms], took_millis[15], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{"query":{"match":{"text":"ronin"}}}], extra_source[],`

If it is possible where i have to configure that?

Question 2:

Slowlog can be configured at per-index not at cluster level. To enable it every time i have to specify a index and enable it .  
There is one way where i can hardcode in elasticsearch.yml file so that all the coming indices will have slowlogs enabled but the drawback is for doing update i have to restart all the nodes which is not good?

Is there any other way?

Thanks

---

<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:** [April 28, 2017, 8:16am UTC](https://discuss.elastic.co/t/append-username-in-the-slowlog-in-elasticsearch-2-4-1/83674/2 "2017-04-28T08:16:57Z")

</div>

Is it not possible.

> [@Yaswanth](#):
>
> There is one way where i can hardcode in elasticsearch.yml file so that all the coming indices will have slowlogs enabled but the drawback is for doing update i have to restart all the nodes which is not good?

I don't think so, I haven't seen anything?

---

<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:** [May 26, 2017, 8:27am UTC](https://discuss.elastic.co/t/append-username-in-the-slowlog-in-elasticsearch-2-4-1/83674/3 "2017-05-26T08:27:43Z")

</div>

Closed on May 26, 2017, 8:27am UTC

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