# How could I change the "agent.name" in a Elastic Agent instance? 8.18

**URL:** <https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271>\
**Category:** Elastic Agent\
**Created:** [November 6, 2025, 1:22pm UTC](https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271 "2025-11-06T13:22:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamuelSMendes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuelsmendes/32/104246_2.png) [@SamuelSMendes](https://discuss.elastic.co/u/SamuelSMendes)\
**Post date:** [November 6, 2025, 1:22pm UTC](https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271/1 "2025-11-06T13:22:53Z")

</div>

Once I’ve used the version 8.5 and we could overide the “agent.name” as well as add some tags in the documents generated by the service by editing the “mtricbeat.yaml” file. But as of now the document no longer exists and I’ve seen no other way to make the change happen.

I’d appreciate any help on the matter.

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [November 8, 2025, 2:41am UTC](https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271/2 "2025-11-08T02:41:08Z")

</div>

Hello @SamuelSMendes

I see below similar issue open as per your requirement :

> <https://github.com/elastic/elastic-agent/issues/86>
>
> \*\*Use Case:\*\* Currently the name attached to the agent is chosen by Elastic - as… in derived from some other entity (i.e machine name). Often these names have no significance to the user of our product who many need to better visually differentiate. In some instances the user is operating a multi tenanted environment and would like to encode the tenant name/ID into the agent name. 
> 
> \*\*Proposal:\*\* Provide a flag for the user to overwrite the given name during installation/enrollment. This name should appear in the Fleet UI.
> 
> \*\*Suggested syntax:\*\*
> 
> elastic-agent enroll --url=https://\<fleet server\> --enrollment-token=\<token\> --name=”CEO laptop”
> 
> elastic-agent install --url=https://\<fleet server\> --enrollment-token=\<token\> --name=”CEO laptop”

For now i believe you can make use of tags which is available to filter your agents :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/8/28b513a815205cee331e1d67c8e524643cf32ca5.png)

Thanks!!

---

<div class="post-metadata">

**Author:** ![SamuelSMendes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuelsmendes/32/104246_2.png) [@SamuelSMendes](https://discuss.elastic.co/u/SamuelSMendes)\
**Post date:** [November 10, 2025, 1:27pm UTC](https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271/3 "2025-11-10T13:27:54Z")

</div>

I see the option there but even once placed in the agent I can’t find any document with the new tag being adressed at.

Shouldn’t the new tag be added to the new documents generated by the agent?

Thanks for the quick answer.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [November 10, 2025, 1:37pm UTC](https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271/4 "2025-11-10T13:37:34Z")

</div>

> [@SamuelSMendes](#):
>
> Shouldn’t the new tag be added to the new documents generated by the agent?

No, this tag is only used for filtering on the Fleet console, they will not be added to documents.

---

<div class="post-metadata">

**Author:** ![SamuelSMendes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuelsmendes/32/104246_2.png) [@SamuelSMendes](https://discuss.elastic.co/u/SamuelSMendes)\
**Post date:** [November 11, 2025, 1:09pm UTC](https://discuss.elastic.co/t/how-could-i-change-the-agent-name-in-a-elastic-agent-instance-8-18/383271/5 "2025-11-11T13:09:57Z")

</div>

Thank you for the reply @leandrojmp.

Is there any way I could get to the bottom of this? To change the “agent.name” or setup a tag to retrieve in the documents?
