# Is there any API to fetch query history?

**URL:** <https://discuss.elastic.co/t/is-there-any-api-to-fetch-query-history/71028>\
**Category:** Elasticsearch\
**Created:** [January 10, 2017, 7:04am UTC](https://discuss.elastic.co/t/is-there-any-api-to-fetch-query-history/71028 "2017-01-10T07:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![microx](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@microx](https://discuss.elastic.co/u/microx)\
**Post date:** [January 10, 2017, 7:04am UTC](https://discuss.elastic.co/t/is-there-any-api-to-fetch-query-history/71028/1 "2017-01-10T07:04:13Z")

</div>

Hi all,

I'd like to access the query history of users by invoking API for analyzing the user behavior. From the document, it seems that Elastic Search does not provide such an API for fetching query history. After googling, someone accomplished this by forwarding the log of Elastic Search to another Elastic Search server. In this forum, one related question was answered that slow log setting could make the Elastic Search server record both query requests and bodies. I am wondering that is any approach to retrieving the query history of an Elastic Search server? Any comment is greatly appreciated.

Best regards,  
Chen-Che

---

<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:** [January 12, 2017, 5:53am UTC](https://discuss.elastic.co/t/is-there-any-api-to-fetch-query-history/71028/2 "2017-01-12T05:53:08Z")

</div>

There is nothing like this at this stage.

---

<div class="post-metadata">

**Author:** ![microx](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@microx](https://discuss.elastic.co/u/microx)\
**Post date:** [January 13, 2017, 7:52am UTC](https://discuss.elastic.co/t/is-there-any-api-to-fetch-query-history/71028/3 "2017-01-13T07:52:28Z")

</div>

Hi Mark,

I see. Thanks for your reply.

Best regards,  
Chen-Che

---

<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:** [February 10, 2017, 7:52am UTC](https://discuss.elastic.co/t/is-there-any-api-to-fetch-query-history/71028/4 "2017-02-10T07:52:34Z")

</div>

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