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