06 Feb 2023
08:13 PM
- last edited on
07 Feb 2023
10:58 AM
by
Ana_Kuzmenchuk
Hello, team!
I try to create a calculated service metric. It must capture request like: /projects/{projectId}/files/**
For example: projects/platform_features/files/help/
When I create a metric, I use the condition "request name contains regex /project\/.*\/files/.*[a-zA-Z0-9]" - this condition doesn't work, because in metric there is "no data", but I see these requests in MDA.
I tried to use another regex: /project/[a-zA-Z0-9]*/files/.*[a-zA-Z0-9] - but Dynatrace show me the message "Greedy or lazy character classes are not allowed, please use a possessive quantifier instead."
And I tried the third variant: /project/[a-zA-Z0-9]/files/.*[a-zA-Z0-9] - Dynatrace doesn't show me an error, but when I try check this regex in regex101.com - it's an "invalid expression".
Could you help me?
Solved! Go to Solution.
07 Feb 2023 05:31 AM - edited 07 Feb 2023 05:38 AM
Hi @Fisher,
2 things with Your regexes -
I Believe You were looking for:
\/project\/[a-zA-Z0-9]++\/files\/[a-zA-Z0-9]++
Small tip for future with regexes 🙂
07 Feb 2023 09:46 AM
Thank you, Michal.
But it doesn't work(
I still can't see data in this calculated metric
07 Feb 2023 11:09 AM
Hello from Nightmare...
\/projects\/(?>[a-zA-Z0-9-_]++)\/files\/(?>[a-zA-Z0-9-_]++)\/ |
Regards,
Romanenkov Alex
07 Feb 2023 12:05 PM
Colleagues, thanks for help!
But trouble was so easy - I missed letter "s" in word project
I'm sorry!
07 Feb 2023 02:04 PM
Hi @Fisher thank you for sharing what the solution happened to be! Even though it was a typo, it started a discussion that I think many people will find useful!