Help with regular expression
Asked by Marcel Maas:

I want to trigger with a regular expression that if the percent is below 10% the alarm will be triggert who can help ? with how it looks like

Current Incoming ASR **10%**


Answers:
author: Nick H
body: Hi [@Marcel Maas](/t5/user/viewprofilepage/user-id/4800740) ,

I was able to get this use case working through a [notification policy](https://support.atlassian.com/opsgenie/docs/create-and-manage-team-alert-policies/#Notification-Policy), and a regex expression like:

```
.*(\d{2,}).*
```

![reg1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/187292i5F9F961E25D2FCB2/image-size/large?v=v2&px=999 "reg1.jpg")

The notification policy above would delay/suppress alerts that contain anything in the message field with numbers greater than 2 digits. Here are a few tests I ran as well:

![reg2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/187287iA8BFEEFEA49B227B/image-size/large?v=v2&px=999 "reg2.jpg")![reg3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/187288i405C8A1D1DCB37DD/image-size/large?v=v2&px=999 "reg3.jpg")

The first test, #2042, suppressed notifications for 10%. The second test, #2046, notified the on-call user for 5%.

Notification policies are only available on the Standard and Enterprise plans. So if your subscription does not provide this functionality, I suppose you could use a routing rule that sends these alerts to No-one:

![reg4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/187293iD80BFB5C1BFED6C3/image-size/large?v=v2&px=999 "reg4.jpg")![reg5.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/187294iD1A816418975F7E4/image-size/large?v=v2&px=999 "reg5.jpg")

comments: author: Marcel Maas
body: Thats already a step but there are more alarm coming in any it should only get a trigger when the alarm text is **Current Incoming ASR** **10%**with a percentage behind it what should trigger the regex. So in your example on any message received the regex will be checked ?


author: Nick H
body: Yes - any message received will review the policy and check the filter's regex - but the policy will suppress notifications on alerts that contain \<=10% in the message.


author: Marcel Maas
body: I receive serveral messages to my team channel and expect more rules so it should only trigger when the message start with Current Incoming ASR \<=10%

The could also be a message e.q. Current Outgoing ASR 9% and the regex should not trigger on that one and go to the escalation schedule


author: Nick H
body: You can add multiple conditions to the filter to meet your use case. The regex shared above is only filtering on the numerical value. You can add another condition to filter on "Current Incoming," "Current Outgoing," etc. - again - whatever your use case is:

![reg6.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/187555i886EC9740722629D/image-size/large?v=v2&px=999 "reg6.jpg")


author: Marcel Maas
body: Still not working if it is 99% or 2% still always a alert is coming out when this mail is receiveed with

Current Incoming ASR 99%

Current Incoming ASR 1%

Looks like setting are the same as your screen shot


Tags: regex