# Send host name with Alert

**URL:** <https://community.grafana.com/t/send-host-name-with-alert/80590>\
**Category:** Alerting\
**Created:** [January 28, 2023, 3:58pm UTC](https://community.grafana.com/t/send-host-name-with-alert/80590 "2023-01-28T15:58:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![madddogg2406](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@madddogg2406](https://community.grafana.com/u/madddogg2406)\
**Post date:** [January 28, 2023, 3:58pm UTC](https://community.grafana.com/t/send-host-name-with-alert/80590/1 "2023-01-28T15:58:35Z")

</div>

Hello, I wanted to send the hostname of an alerted host with the e-mail, and I stumbled up on to use something like this in the alert description:  
Host: {{ $values.B0.value.labels.host }}

But if an alert triggers, it will just write the literal “{{ $values.B0.value.labels.host }}” instead of the hostname. Trying just $values.B0.labels.host gave me a “\<no value”

I heard there are alert templates, but I just want to add one variable and not re-write the whole alert e-mail.

---

<div class="post-metadata">

**Author:** ![ldrascic](https://avatars.discourse-cdn.com/v4/letter/l/aca169/32.png) [@ldrascic](https://community.grafana.com/u/ldrascic)\
**Post date:** [January 28, 2023, 4:46pm UTC](https://community.grafana.com/t/send-host-name-with-alert/80590/2 "2023-01-28T16:46:48Z")

</div>

Hi @madddogg2406,  
If you are using Reduce expression in your alert try this:

```auto
{{ $values.B.Labels.host }}

```

If you are using Classic condition expression try this:

```auto
{{ $values.B0.Labels.host }}

```

> [@How To Use Alert Message Templates in Grafana](https://community.grafana.com/t/how-to-use-alert-message-templates-in-grafana/67537/129):
>
> Hi @rodrigoparavano, If you want to get label value from query then you can do with: {{ $values.\<queryname\>.Labels.\<tag\> }} For example: On server {{ $values.B.Labels.host }} port {{ $values.B.Labels.port }} is closed (not listening). would print: On server monitoringserver port 8282 is closed (not listening).
> 
> > **Alert configuration and output**
> >
> > \<a class="lightbox" href="https://us1.discourse-cdn.com/grafana/original/3X/7/0/706158fc7637855f8a674f514e16f35262cd9f79.png"…

Best regards,  
ldrascic

---

<div class="post-metadata">

**Author:** ![madddogg2406](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@madddogg2406](https://community.grafana.com/u/madddogg2406)\
**Post date:** [January 28, 2023, 9:40pm UTC](https://community.grafana.com/t/send-host-name-with-alert/80590/3 "2023-01-28T21:40:25Z")

</div>

Ah okay I will try this. Is a Threshold also a B0 or a B?

---

<div class="post-metadata">

**Author:** ![georgerobinson](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@georgerobinson](https://community.grafana.com/u/georgerobinson)\
**Post date:** [January 30, 2023, 3:17pm UTC](https://community.grafana.com/t/send-host-name-with-alert/80590/4 "2023-01-30T15:17:20Z")

</div>

Hi! If it helps the documentation for this can be found here [Templating labels and annotations | Grafana documentation](https://grafana.com/docs/grafana/latest/alerting/fundamentals/annotation-label/variables-label-annotation/), including for Classic Conditions.

To answer the question it is just Classic Conditions that use `B0` , `B1`, etc. Reduce, Threshold and Math expressions do not. This is because each individual Classic Condition can contain multiple conditions.
