cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

help with regex for user action extraction rule

gilgi
DynaMight Champion
DynaMight Champion

Hi,

 

We have an application that some of its page titles are comprised of the following structure:

371000 037386109 1440

We want (if possible) to be able to make the user action name include only the first and last part of the title, i.e. 371000 1440.

Being novice in regex and knowing only one capture group is possible, is that even possible ?

Gil.

 

 

5 REPLIES 5

Julius_Loman
DynaMight Legend
DynaMight Legend

This regex should work for your case:
(\d+) \d+ (\d+)

and the replacement string is

$1 $2

However, it cannot be used in the extraction rule, since that rule allows only one capture group. But you can use it in the cleanup rule.

This is unfortunately very unintuitive and took me a while to figure out how to use multiple capture groups for user actions.


Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

gilgi
DynaMight Champion
DynaMight Champion

Thanks @Julius L.


However, cleanup rules apply on URL's and not the page title as far as I recall. Am I wrong ?


Yes, that's correct. I overlooked that information from your first post. Sorry.
I don't think there is a solution right now to extract two capture groups and define user action from other metadata than URL. You can use the JS API to name your action (if it's suitable for your case). Isn't it possible to capture the information you need from another place?

There another much more powerful rule engine for user actions planned, but I don't know when this is going to be available.


Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

gilgi
DynaMight Champion
DynaMight Champion

Thanks @Julius L.


However, cleanup rules apply on URL's and not the page title as far as I recall. Am I wrong ?


Correct. In 2019 when old user action naming rules style was in place, this was the case and regex were applicable only in URLs.

Not anymore with the current user action naming where regular expressions and extractions can be used for any placeholder.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts