# Metricbeat: anyway to capture alternatives host.name in aws ec2?

**URL:** <https://discuss.elastic.co/t/metricbeat-anyway-to-capture-alternatives-host-name-in-aws-ec2/370328>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 11, 2024, 3:31pm UTC](https://discuss.elastic.co/t/metricbeat-anyway-to-capture-alternatives-host-name-in-aws-ec2/370328 "2024-11-11T15:31:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_Laguna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruben_laguna/32/21303_2.png) [@Ruben\_Laguna](https://discuss.elastic.co/u/Ruben_Laguna)\
**Post date:** [November 11, 2024, 3:31pm UTC](https://discuss.elastic.co/t/metricbeat-anyway-to-capture-alternatives-host-name-in-aws-ec2/370328/1 "2024-11-11T15:31:43Z")

</div>

I have an EC2 instance and metricbeat is setting host.name to i-xxxxxxxx.eu-north-1.compute.internal which is correct. But this machine has an alternative hostname for me "[xxxxx.mycompany.com](http://xxxxx.mycompany.com)".

What is the best way to capture both hostnames? So that I can search using both hostnames. What is the best practice in this case?
