30 Mar 2021 08:50 PM
Hi all,
Need to create a global request naming rule which will extract everything before the last / and then append <ID> to the resulting name. Having trouble creating a regex pattern that does not break DT's rules (it's either greedy or too expensive). Could someone help out with this one?
/URI-A/URI-B/URI-C/URI-D/04w0da444d979e74GSDFGS92f75e0d1e187f9?timestamp=1234
/URI-A/URI-B/URI-C/04w0da444d979e74GSDFGS92f75e0d1e187f9?timestamp=1234
/URI-A/URI-B/URI-C/URI-D/
/URI-A/URI-B/URI-C/
/URI-A/URI-B/URI-C/URI-D/<ID>
/URI-A/URI-B/URI-C/<ID>
Solved! Go to Solution.
31 Mar 2021 01:52 AM
Hope that one of these two options help
1st option:
2nd option:
06 Apr 2021 08:33 PM
Unfortunately, both are invalid options - the second one is greedy and has multiple capture groups which are some of the DT regex restrictions 😞
https://www.dynatrace.com/support/help/shortlink/regex#restrictions
08 Apr 2021 08:56 AM
Hi Diana,
Try this one...
(.*?\/)[^\/]++\/?$
It will extract everything up to and including the final "/" of the URL, and it will be accepted by Dynatrace regex for request naming rules.
Best regards,
Radu
09 Apr 2021 04:42 PM
Hi Radu,
That one is also not accepted:
12 Apr 2021 07:34 AM
Sorry, forgot to add the ^ at the beginning:
^(.*?\/)[^\/]++\/?$
12 Apr 2021 06:43 PM
Awesome, that works! Thanks Radu 😊