# Getting Alerts and Actions to work

**URL:** <https://discuss.elastic.co/t/getting-alerts-and-actions-to-work/266086>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [March 3, 2021, 10:27am UTC](https://discuss.elastic.co/t/getting-alerts-and-actions-to-work/266086 "2021-03-03T10:27:02Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gmmorris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gmmorris/32/72624_2.png) [@gmmorris](https://discuss.elastic.co/u/gmmorris)\
**Post date:** [March 9, 2021, 1:34pm UTC](https://discuss.elastic.co/t/getting-alerts-and-actions-to-work/266086/3 "2021-03-09T13:34:59Z")

</div>

hey @Ilai_Velocity ,  
Sorry you encountered this somewhat broken UX 😬

> [@Ilai\_Velocity](#):
>
> First, I would expect the managed elasticsearch to have this populated

Agreed, and this is in process.  
There are a variety of complications which might not be obvious looking in from the outside.  
As there are a wide range of deployment strategies (such as multiple Kibana across managed and unmanaged, different proxies in front of served Kibana etc.), configuring this out ofthe box has proved tricky.

> [@Ilai\_Velocity](#):
>
> I tried editing it in the `kibana.yml` in the management console but I got an error: "Your changes cannot be applied. Kibana - 'server.publicBaseUrl': is not allowed".

That said, this is an obvious oversight - you should be able to set this manually.  
I've spoken to the team that owns this configuration and they have assured me they'll look to add this to the allowlist asap.

> [@Ilai\_Velocity](#):
>
> Question 2 -  
> I tried placing newlines ("\n" ) inside a JSON field in the body of a webhook action, but it got messed up. How can create new lines in JSON messages?

I am aware of an [issue](https://github.com/elastic/kibana/issues/81849) with newlines which we're hoping to get to as part of 7.13 (though, I can't commit to that), but it looks like using explicit "\n" works.  
Could you share the exact config that's failing for you?

> [@Ilai\_Velocity](#):
>
> I'm trying to close an alert in Opsgenie after the alert was recovered, and this requires setting a variable URL (.../alerts/close/{{alertId}}) but I suspect mustache variables are not populated in webhook URLs. How can this be solved?

You're correct- this isn't supported at the moment.  
We began looking into this and realised there's actually a security/safety difficulty here.  
The complexity to this is that it would mean _user A_ could provide authorization for a specific URL, but _user B_ could then programatically change where that URL is pointing.  
We have to find a good safe way of modeling this feature in a manner that keeps it secure and safe to use.

In the meantime, we're hoping to find capacity for the development of a dedicated OpsGenie Connector type in 7.13 (but as stated above, I can't commit to that).  
You can track the issue [here](https://github.com/elastic/kibana/issues/56403)

> [@Ilai\_Velocity](#):
>
> Is there a way to troubleshoot why alerts are firing off?

That depends on the Alert Type. 🤔

> [@Ilai\_Velocity](#):
>
> I have an alert that is configured to alert for every unique value of a field, and it is firing for instance `*` (star), but that's not a value of the field. I suspect it's a bug on your side?

That does sound weird, but I can't confirm if it's a bug without more details.  
Could you provide more details for where you're encountering this?

What Alert Type is this?  
How is it configured?  
Can you provide an example of the data that it's alerting on?

---

_[View the full topic](https://discuss.elastic.co/t/getting-alerts-and-actions-to-work/266086)._
