# Have a custom string appear in Elastic's logs when indexing a document

**URL:** <https://discuss.elastic.co/t/have-a-custom-string-appear-in-elastics-logs-when-indexing-a-document/25319>\
**Category:** Elasticsearch\
**Created:** [July 10, 2015, 3:00pm UTC](https://discuss.elastic.co/t/have-a-custom-string-appear-in-elastics-logs-when-indexing-a-document/25319 "2015-07-10T15:00:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itrend](https://avatars.discourse-cdn.com/v4/letter/i/6f9a4e/32.png) [@itrend](https://discuss.elastic.co/u/itrend)\
**Post date:** [July 10, 2015, 3:00pm UTC](https://discuss.elastic.co/t/have-a-custom-string-appear-in-elastics-logs-when-indexing-a-document/25319/1 "2015-07-10T15:00:20Z")

</div>

Hello,

I have a client requirement that every single time a document is indexed or updated, I should somehow send a token to Elastic with the sole purpose of that token appearing in Elastic logs\*. Googling around lead me to [elasticsearch-jetty](https://github.com/sonian/elasticsearch-jetty) which kind-of sort-of could do that, but is quite outdated. I couldn't find any other solutions. Thoughts?

\* elaborating on the client scenario: documents have fairly long flow through several client micro-services. A "transaction id" is generated when the flow starts and each micro-service then logs this transaction id so that the "transaction" can be tracked and searched for in log aggregators. The client would like Elastic - as a final step - to also log this transaction id. Somehow.

---

<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:** [July 12, 2015, 8:36am UTC](https://discuss.elastic.co/t/have-a-custom-string-appear-in-elastics-logs-when-indexing-a-document/25319/2 "2015-07-12T08:36:26Z")

</div>

This might be tough I'm afraid, I don't think Shield can do this level of logging at the moment.

---

<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:** [July 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/have-a-custom-string-appear-in-elastics-logs-when-indexing-a-document/25319/3 "2017-07-06T00:02:08Z")

</div>

Closed on July 6, 2017, 12:02am UTC


