# X-opaque-id not displayed in search slow log

**URL:** https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067
**Category:** Elasticsearch
**Created:** [August 20, 2021, 10:55am UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067 "2021-08-20T10:55:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![asgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asgs/32/35909_2.png) [@asgs](https://discuss.elastic.co/u/asgs)
#### Post date: [August 20, 2021, 10:55am UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/1 "2021-08-20T10:55:18Z")

</div>

Hello. First of all, I want to mention that I have read the similar posts [Cannot see user "id" in slowlogs (X-Opaque-ID)](https://discuss.elastic.co/t/cannot-see-user-id-in-slowlogs-x-opaque-id/239555) and [Elasticsearch X-Opaque-Id Not in application.log Exception](https://discuss.elastic.co/t/elasticsearch-x-opaque-id-not-in-application-log-exception/216739) but there are no responses there, so I'm posting my question

so, we are using Amazon ES v7.7 and are experiencing slow queries often. Both indexing and search types. I understood from the documentation that we could attach an HTTP Header X-Opaque-Id to the request that will reflect in the slow log as an id at the end of the line

I tried setting this header and our application logs confirm it's indeed attached to the request but the slow logs don't retain the id. Below is a sample log

```auto
[2021-08-20T02:32:22,691][TRACE][index.search.slowlog.query.oyyhvC_jSOa-vV6-ns6ihQ] [2d9ef1eb5e635897f792affedacc870b] [attr.mutjwian][4] took[1.8s], took_millis[1895], total_hits[973864+ hits], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{"from":0,"size":24,"post_filter":{"bool":{"must":[{"term":{"ourId":{"value":189,"boost":1.0}}},{"bool":{"must":[{"term":{"ourAttributes.our_id.long":{"value":189,"boost":1.0}}},{"term":{"deleted":{"value":"false","boost":1.0}}},{"term":{"specialIds":{"value":6182,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"version":true,"_source":{"includes":["newId"],"excludes":[]},"sort":[{"fewAttributes.modified.date":{"order":"desc","missing":"_last","unmapped_type":"keyword"}}]}], id[]

```

Please ask any questions for further info. Thank you!  
@pgomulka tagging you here for visibility

---

<div class="post-metadata">

### Author: ![pgomulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pgomulka/32/45766_2.png) [@pgomulka](https://discuss.elastic.co/u/pgomulka)
#### Post date: [August 20, 2021, 11:26am UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/2 "2021-08-20T11:26:41Z")

</div>

could there be a proxy that is filtering that header in your system architecture?  
can you confirm that X-Opaque-Id is present on a response headers?

try to turn on http tracing in elasticsearch by following this

> **[Networking | Elasticsearch Guide \[7.14\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#http-rest-request-tracer)**

if x-opaque-id was present on a request, it should be printed out in these logs  
be careful if this is your prod env, it can be very noisy. Try this in test first

---

<div class="post-metadata">

### Author: ![asgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asgs/32/35909_2.png) [@asgs](https://discuss.elastic.co/u/asgs)
#### Post date: [August 20, 2021, 12:25pm UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/3 "2021-08-20T12:25:55Z")

</div>

@pgomulka thank you for the pointers

I'm not getting the response header corresponding to the opaque id. so, it might be dropped in between?

I tried to enable TRACE logging but I got an HTTP 401 status back. Let me check further and update here

---

<div class="post-metadata">

### Author: ![asgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asgs/32/35909_2.png) [@asgs](https://discuss.elastic.co/u/asgs)
#### Post date: [August 23, 2021, 12:52pm UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/4 "2021-08-23T12:52:02Z")

</div>

> [@pgomulka](#):
>
> try to turn on http tracing in elasticsearch by following this

hello, @pgomulka

Looks like AWS ES [restricts the options](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-supported-es-operations.html#es_version_7_7) we could provide while updating the cluster settings. so, I can't enable trace logging. I tried hitting requests in my local ES and ES echoes the header back

so with AWS ES, we're stuck for now. I'll try to ask a question in AWS forums and see why the VPC domain they expose doesn't passthrough the headers we send and if there's a way to override it

---

<div class="post-metadata">

### Author: ![asgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asgs/32/35909_2.png) [@asgs](https://discuss.elastic.co/u/asgs)
#### Post date: [August 23, 2021, 2:59pm UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/5 "2021-08-23T14:59:41Z")

</div>

Raised a question on AWS Forums - [https://forums.aws.amazon.com/thread.jspa?messageID=993728&#993728](https://forums.aws.amazon.com/thread.jspa?messageID=993728&#993728)

---

<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: [August 23, 2021, 9:59pm UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/6 "2021-08-23T21:59:31Z")

</div>

FYI the aws service is not Elasticsearch, we are unable to help with that sorry to say.

---

<div class="post-metadata">

### Author: ![asgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asgs/32/35909_2.png) [@asgs](https://discuss.elastic.co/u/asgs)
#### Post date: [August 24, 2021, 8:19am UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/7 "2021-08-24T08:19:19Z")

</div>

hello, @warkolm

I'm aware of the differences between the two offerings. This problem is a restriction explicitly placed by AWS and I totally understand Elastic as a company can't solve it

thank you!

---

<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: [September 21, 2021, 8:19am UTC](https://discuss.elastic.co/t/x-opaque-id-not-displayed-in-search-slow-log/282067/8 "2021-09-21T08:19:26Z")

</div>

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