# Possible to override beat.hostname in local metricbeat

**URL:** <https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 11, 2018, 3:14pm UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116 "2018-01-11T15:14:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [January 11, 2018, 3:14pm UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116/1 "2018-01-11T15:14:44Z")

</div>

I wondered if I could override default value of beat.hostname in metricbeat.yml as I have classing short hostnames?

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [January 12, 2018, 4:37am UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116/2 "2018-01-12T04:37:10Z")

</div>

Hostname can't be overwritten but you can overwrite `beat.name` (in the config under `name` ) for this purpose.

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [January 12, 2018, 8:41am UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116/3 "2018-01-12T08:41:36Z")

</div>

Yes already done that, it's just because we use hostname in a grafana template 🙂

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [January 16, 2018, 3:51am UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116/4 "2018-01-16T03:51:45Z")

</div>

Hehe, what about changing the Grafana template? 😇

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [January 16, 2018, 9:27am UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116/5 "2018-01-16T09:27:02Z")

</div>

Also changed Grafana template to use [beat.name](http://beat.name), but as events already are parsing through logstash also changed hostnames by:

```
mutate {
  replace => { '[beat][hostname]' => "%{[beat][name]}" }
}

```

🙂

---

<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:** [February 13, 2018, 9:27am UTC](https://discuss.elastic.co/t/possible-to-override-beat-hostname-in-local-metricbeat/115116/6 "2018-02-13T09:27:13Z")

</div>

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