# Adding metadata to a query for slow log analysis

**URL:** <https://discuss.elastic.co/t/adding-metadata-to-a-query-for-slow-log-analysis/206664>\
**Category:** Elasticsearch\
**Created:** [November 5, 2019, 6:55pm UTC](https://discuss.elastic.co/t/adding-metadata-to-a-query-for-slow-log-analysis/206664 "2019-11-05T18:55:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocky67z](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rocky67z](https://discuss.elastic.co/u/rocky67z)\
**Post date:** [November 5, 2019, 6:55pm UTC](https://discuss.elastic.co/t/adding-metadata-to-a-query-for-slow-log-analysis/206664/1 "2019-11-05T18:55:18Z")

</div>

I have reviewed the Elasticsearch reference and have been unable to identify a way to add miscellaneous metadata to a query (not as query parameters to match/filter results), but instead specifically for the purposes of recording metadata in the index search slow log for analysis. Here are three very simple examples of miscellaneous metadata that I would like to appear in the slow log for a given slow query:

- application search category (front-end search applications allows for different categories of feature-based searches)
- application search unique id (a unique id assigned to every user search)
- policy code (various searches that were conducted based on a policy search)

Is this possible?

---

<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:** [December 3, 2019, 6:55pm UTC](https://discuss.elastic.co/t/adding-metadata-to-a-query-for-slow-log-analysis/206664/2 "2019-12-03T18:55:24Z")

</div>

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