28 Dec 2023 10:35 AM - last edited on 11 Mar 2024 06:12 PM by donald_ferguson
I wanted to do some operations with regular expressions and I am a little bit lost.
1- I wanted to delete a part of the request.
2-I wanted to make a request disappear.
Can you help me?
28 Dec 2023 11:16 AM
For example I want from these examples:
/Borradores/Errors/getErrors/57580
/Borradores/Errors/getFormatsErrors/57580/312
Only show /Borradores/Errors the rest do not.
I made this that in a test works for me but not here:([^v]Borradores/Errors)
And the second case is that for example I get this request:
/Health and I want to delete it every time it comes out(That it doesn't show me anything).
28 Dec 2023 12:01 PM
I don't know if this is the cleanest regex possible but it should works :
(.[^\/]++.[^\/]++.)
For request I don't want to follow or receive alert I use muted request :
https://docs.dynatrace.com/docs/shortlink/service-monitoring-mute
28 Dec 2023 12:29 PM
I don't want to mute it, I want Health to disappear and appear either alone / or blank. But only that request, I want the rest to stay like that.
28 Dec 2023 12:39 PM
In this case it should be blank space instead of /Health
(.*)\bHealth\/\b(.*)
28 Dec 2023 01:15 PM
Ok it's clear.
As you cannot have more than one capture group in the regex, maybe you should try to enable a naming rule with 2 placeholders where each one have a regex that extract before and after the health part in your request :
28 Dec 2023 12:01 PM
HI!,
Try this ^(.*?)Errors
28 Dec 2023 12:33 PM
In the test it does not do it for me