Tried that - i am still getting “no value” , I’ve tried using {{ $labels.app }} in the past for the info where value was saved in “app” field - This time since the value is in “metadata.label.user.app” it’s unable to capture value.
Can you (just for test purposes) create a label that does not have dots in the name and see if that works?
This info below is from our resident expert @melori.arellano in another post, but may be applicable here…
Examples for specific situations like . . .
When a label has dots in the name
If you have a label like netflow.ipv4_dst_addr with a value of 192.168.1.1, you might find that your alert template just shows the raw template (which is what happens if there’s an error in the evaluation).
If you’re using a classic condition, here’s an example of using the go index function:
{{ index $values.B0.Labels “netflow.ipv4_dst_addr” }}
if your alert has two or more conditions or an expression, then you can use the $labels variable:
{{ index $labels “netflow.ipv4_dst_addr” }}
@Rohan can you try something like this? I used a dummy test datasource and gave it one of your test labels with dots in the name. Then, I set the value of metadata.label.user.app to slack.
My default notification policy is email. To test that the label is working. I created a rule to route alerts with metadata.label.user.app=slack to my slack contact point overriding the default:
Thanks @melori.arellano, the Rule is working for a Math expression -
However for Classic condition where it says “{{ index $values.B0.Labels “netflow.ipv4_dst_addr” }}” based on the example shared by @grant2 - I have two queries and an Expression which is a Classic condition