# Override requestid or set a value of the mapped diagnostic context for elasticsearch?

**URL:** <https://discuss.elastic.co/t/override-requestid-or-set-a-value-of-the-mapped-diagnostic-context-for-elasticsearch/115260>\
**Category:** Elasticsearch\
**Created:** [January 12, 2018, 9:53am UTC](https://discuss.elastic.co/t/override-requestid-or-set-a-value-of-the-mapped-diagnostic-context-for-elasticsearch/115260 "2018-01-12T09:53:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blommis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blommis/32/98529_2.png) [@blommis](https://discuss.elastic.co/u/blommis)\
**Post date:** [January 12, 2018, 9:53am UTC](https://discuss.elastic.co/t/override-requestid-or-set-a-value-of-the-mapped-diagnostic-context-for-elasticsearch/115260/1 "2018-01-12T09:53:22Z")

</div>

Is it possible to override or set request\_id in logging?  
We are using MDC, Mapped Diagnostic Context, to set a transaction/context id, such as every request logs a transaction log.  
But the few times there is a log message from elasticsearch, this is done in another thread and there is no transaction id.  
Or if it's possible to use an supplier that sets the transaction id in a thread?

Checked the code, found out that the requestid is set in the transport interface. But didnt find a good way of how to oveeride it.

[elasticsearch[_client_][generic][T#4]] INFO o.e.c.t.TransportClientNodesService failed to get node info for {#transport#-2}{q6...}{...}{...}, disconnecting...  
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][...][cluster:monitor/nodes/liveness] request\_id [**49078**] timed out after [5000ms]  
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:908)  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:527)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at java.lang.Thread.run(Thread.java:748)

---

<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 9, 2018, 9:53am UTC](https://discuss.elastic.co/t/override-requestid-or-set-a-value-of-the-mapped-diagnostic-context-for-elasticsearch/115260/2 "2018-02-09T09:53:51Z")

</div>

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