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
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
Apologies, the regex got reformatted. Here is the correct one:
{{Value: \{{message.extract(/Monitor: .+\s+(.+)/)}}}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Afonso Henrique Rodrigues Alves You're most welcome! :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.