# Elastic Agent : Rename agent names or add a field to differentiate them

**URL:** <https://discuss.elastic.co/t/elastic-agent-rename-agent-names-or-add-a-field-to-differentiate-them/357491>\
**Category:** Elastic Agent\
**Created:** [April 16, 2024, 9:10am UTC](https://discuss.elastic.co/t/elastic-agent-rename-agent-names-or-add-a-field-to-differentiate-them/357491 "2024-04-16T09:10:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [April 16, 2024, 9:10am UTC](https://discuss.elastic.co/t/elastic-agent-rename-agent-names-or-add-a-field-to-differentiate-them/357491/1 "2024-04-16T09:10:06Z")

</div>

Hello,

I'd like to deploy several agents on client servers, in fleet mode. The problem is that the agent name comes from the host machine name, and these names are often unknown to our teams. Of course, it's impossible to change the machine names.

Is it possible to give an agent a name each time it is deployed?  
Or add a hard-coded field directly to its .yml file? But this might not be used if I use a Policy?

Thx for your answers.

---

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [November 13, 2024, 12:54pm UTC](https://discuss.elastic.co/t/elastic-agent-rename-agent-names-or-add-a-field-to-differentiate-them/357491/2 "2024-11-13T12:54:52Z")

</div>

For those of you who need help, the only solution I've found is to use Tags to differentiate between agents.

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [November 16, 2024, 6:22am UTC](https://discuss.elastic.co/t/elastic-agent-rename-agent-names-or-add-a-field-to-differentiate-them/357491/3 "2024-11-16T06:22:46Z")

</div>

You can use a simple ingest pipeline or use lookups/enrich to replace agent.name.

For example you could create a table of agent.id to ideal name and then use an ingest pipeline to do the replacement

---

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [November 18, 2024, 8:30am UTC](https://discuss.elastic.co/t/elastic-agent-rename-agent-names-or-add-a-field-to-differentiate-them/357491/4 "2024-11-18T08:30:25Z")

</div>

I haven't thought about enrichment, but it sounds like a good idea. But I don't know the agent's id in advance. I'll look into it, thanks
