# Passing requestId in ES logs

**URL:** <https://discuss.elastic.co/t/passing-requestid-in-es-logs/99498>\
**Category:** Elasticsearch\
**Created:** [September 6, 2017, 12:58am UTC](https://discuss.elastic.co/t/passing-requestid-in-es-logs/99498 "2017-09-06T00:58:19Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [September 6, 2017, 2:24pm UTC](https://discuss.elastic.co/t/passing-requestid-in-es-logs/99498/4 "2017-09-06T14:24:51Z")

</div>

Hi @animageofmine,

stats groups are per request. You define them directly in your query. Copying the example that I gave in the other thread verbatim:

```auto
GET /_search
{
    "query": {
        "match_all": {}
    },
    "stats" : ["myapplication"]
}

```

This will show up in the slow query log as:

```auto
[2017-05-26 12:12:08,011][INFO][index.search.slowlog.fetch] [Elven] [old_books][3] took[219.7micros], took_millis[0], types[], stats[myapplication], search_type[QUERY_THEN_FETCH], total_shards[5], source[{"query":{"match_all":{}},"stats":["myapplication"]}], extra_source[], 

```

Daniel

---

_[View the full topic](https://discuss.elastic.co/t/passing-requestid-in-es-logs/99498)._
