# How do i get data from the value string?

**URL:** <https://community.grafana.com/t/how-do-i-get-data-from-the-value-string/70854>\
**Category:** Alerting\
**Created:** [August 22, 2022, 12:04am UTC](https://community.grafana.com/t/how-do-i-get-data-from-the-value-string/70854 "2022-08-22T00:04:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![malcolm16](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/malcolm16/32/18586_2.png) [@malcolm16](https://community.grafana.com/u/malcolm16)\
**Post date:** [August 22, 2022, 12:04am UTC](https://community.grafana.com/t/how-do-i-get-data-from-the-value-string/70854/1 "2022-08-22T00:04:34Z")

</div>

I have alerts setup and working in Grafana 9, mostly OK.

When i get the alerts they have something like this in the text,

**Value:** [var=‘B0’ metric=‘rpi3’ labels={ **name** =up, instance=rpi3:9100, job=raspberry, short\_hostname=rpi3} value=0]

How do i separate out the value in metric (rpi3) and value (0) to put them in say the Labels section in the email or somewhere else in the email.  
I want to make them easier to see/read.

---

<div class="post-metadata">

**Author:** ![melori.arellano](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/melori.arellano/32/23041_2.png) [@melori.arellano](https://community.grafana.com/u/melori.arellano)\
**Post date:** [September 21, 2022, 9:53pm UTC](https://community.grafana.com/t/how-do-i-get-data-from-the-value-string/70854/2 "2022-09-21T21:53:52Z")

</div>

@malcolm16 if you still need help with this, I posted a solution in this thread:

> [@How To Use Alert Message Templates in Grafana](https://community.grafana.com/t/how-to-use-alert-message-templates-in-grafana/67537/3):
>
> Edited this solution to add the most common answers in this thread in one place, including template functions and labels with dots in the name - read through to the end for those welcome to the grafana community @baileyheit1! This is a really common question and I’m still learning how to access the values out of the alert query too. I hope this is a helpful example - I tried to make it very detailed for the benefit of other community users, even though I can tell you already know how to do s…

---

<div class="post-metadata">

**Author:** ![benjamingslade](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/benjamingslade/32/5718_2.png) [@benjamingslade](https://community.grafana.com/u/benjamingslade)\
**Post date:** [May 12, 2025, 4:42pm UTC](https://community.grafana.com/t/how-do-i-get-data-from-the-value-string/70854/3 "2025-05-12T16:42:44Z")

</div>

Thanks for posting that, but it’s really really complicated. For example,  
" `.Labels` mentioned in the Template Data docs refer to the labels attached to the alert object NOT the query response labels"  
That’s really complicated
