Hello. First of all, I want to mention that I have read the similar posts Cannot see user "id" in slowlogs (X-Opaque-ID) and Elasticsearch X-Opaque-Id Not in application.log Exception 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
[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