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

Does anyone know a cleanup rule that can help get the username out of the title?

adam_sjoerdsma
Dynatrace Helper
Dynatrace Helper

Hi team,

I have an application that I am trying to get the usernames out of the <title> tag.

I am using the JavaScript variable expression type with the "docment.title" variable. this results in grabbing page titles that have the username at the end.

Agile Product Lifecycle Management - Welcome , INCDSYPRD01

INCDSYPRD01 is an example of the usernames I am trying to grab.

I tried a few different times at getting just the username, but I admit I am not the greatest with Regex.

Does anyone have a cleanup rule that might work at just getting the username?

Thanks,

Adam Sjoerdsma

 

5 REPLIES 5

Hi Adam,

If i understand good, you want to find username from page tittle. Please let me know that this username always look the same?

If the username looks like you provided in the example, you can use this regular expression:

(INC[a-zA-Z0-9]+)

Radek


You can test your expressions here: https://regex101.com


We actually want to be able and grab any potential username from the statement. From my understanding this will always be one word that can be any combination of characters or numbers.


For usernames, there is always a common schema. You must then adjust the regex to find it. If you use the name you gave in the forum, you have a ready-made regular expression above.


Radu
Dynatrace Pro
Dynatrace Pro

Hi Adam,

If you want to catch any possible username, and your title will always follow the convention of Welcome , <username> at the end of the string, just use:

Welcome , (.*)$