# Retrieving Node URL from Alert

**URL:** <https://discuss.elastic.co/t/retrieving-node-url-from-alert/372143>\
**Category:** Metrics\
**Tags:** elastic-stack-alerting\
**Created:** [December 18, 2024, 8:09am UTC](https://discuss.elastic.co/t/retrieving-node-url-from-alert/372143 "2024-12-18T08:09:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bartosz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bartosz/32/140126_2.png) [@Bartosz](https://discuss.elastic.co/u/Bartosz)\
**Post date:** [December 18, 2024, 8:09am UTC](https://discuss.elastic.co/t/retrieving-node-url-from-alert/372143/1 "2024-12-18T08:09:29Z")

</div>

I have created simple CPU alert inside Stack Management, with action that send a message to Slack.

I wanted to have the URL to the node causing the alert inside the message.  
I found the url inside `{{context.action}} ` variable, which has the format of `[View node](https://...)`.

However Slack does not support this syntax and show above code as it is

![image](https://us1.discourse-cdn.com/elastic/optimized/3X/7/3/73460d0a3ce9837db35d76c9c81c201b005a64bf_2_690x25.png)

It would be nice to be able to get only the url, without the `[View node]` part.  
If there is a way to do that already, I would appreciate the explanation, if not, I suggest creating ticket for that.

---

<div class="post-metadata">

**Author:** ![atul\_mohan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_mohan/32/137776_2.png) [@atul\_mohan](https://discuss.elastic.co/u/atul_mohan)\
**Post date:** [January 25, 2025, 6:02pm UTC](https://discuss.elastic.co/t/retrieving-node-url-from-alert/372143/2 "2025-01-25T18:02:10Z")

</div>

```auto
{
  "actions": [
    {
      "id": "slack-notification",
      "connector_type_id": ".slack",
      "group": "default",
      "params": {
        "message": "CPU Alert on node: {{#with context.action}}{{#regexMatch '\\[View\\snode\\]\\((https://.*?)\\)' this}}{{{match.1}}}{{/regexMatch}}{{/with}}"
      }
    }
  ]
}

```
