# Add custom fields to metadata with elastic agent jar

**URL:** https://discuss.elastic.co/t/add-custom-fields-to-metadata-with-elastic-agent-jar/352370
**Category:** Elastic Agent
**Created:** [February 2, 2024, 7:52am UTC](https://discuss.elastic.co/t/add-custom-fields-to-metadata-with-elastic-agent-jar/352370 "2024-02-02T07:52:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)
#### Post date: [February 2, 2024, 7:52am UTC](https://discuss.elastic.co/t/add-custom-fields-to-metadata-with-elastic-agent-jar/352370/1 "2024-02-02T07:52:13Z")

</div>

Hi,

I need to add custom fields in metadata of the transactions captured by the java agent jar . Is there any way I can achieve this?  
I read about global\_labels inclusion in elastic agent properties file, But i need to dynamically inject the field at run time when the transaction is captured by the agent.

Please advise on the same.

Best Regards,  
Namita

---

<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: [March 1, 2024, 7:52am UTC](https://discuss.elastic.co/t/add-custom-fields-to-metadata-with-elastic-agent-jar/352370/2 "2024-03-01T07:52:22Z")

</div>

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