Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Regex not matching email message

Edited

We have the following email (included at the bottom) where we want to extract two key pieces of information.

The first is "Monitor: Service - SERVICENAME - Running State"

The second is "Stopped" (which could be anything from "99.9%", "Started", "Stopped", "Running", "1.230s"

These two blocks are the only pieces of information we want going into our alert.

 

I have tried several regex attempts to extract this data, but only the top one works. 

I believe the second regex is not working due to the use of newlines. It's the only thing that differs between the two statements.

Here is my latest attempt at the extract. This code is in the description field of an email integration.

Monitor: {{message.extract(/Monitor: (.+)/)}}
Value: {{message.extract(/Monitor: .+\n+(.+)/)}}

Please could someone point me to where I am going wrong.

Thanks you

Click on [Body.html] attachment for HTML version




Log in to Stackify



Critical
View in Retrace
SERVERNAME (SERVERENVIRONMENT)
Monitor: Service - SERVICENAME - Running State






Stopped


Alerts



Associations
Started
State






SERVICENAME
Wednesday, August 3, 2022 12:13
Critical









Netreo, 7171 Warner Ave. Suite B787, Huntington Beach, CA 92647, USA


© 2022 Netreo | All Rights Reserved

 

1 answer

0 votes
Muhammad Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 04, 2022

Hey Rob,

I have responded to your query in the Support Ticket you opened also. Basically this is what I would like you to for the second one:

Value: {{message.extract(/Monitor: .\s(.+)/)}}

If that does not work could you please just add message in the Description field and create a test alert?

MUHAMMAD ZEESHAN
Technical Support Engineer

Muhammad Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 04, 2022

Apologies, the regex got reformatted. Here is the correct one:

{{Value: \{{message.extract(/Monitor: .+\s+(.+)/)}}}}

@Muhammad Zeeshan Could you point to the latest regex documentation? 

Muhammad Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 10, 2022
Like Muhammad Zeeshan likes this
Muhammad Zeeshan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 10, 2022

@Afonso Henrique Rodrigues Alves You're most welcome! :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events