Substring of a placeholder

Hi,

At this moment, Dynatrace is recognizing some variables and they are saved as placeholders to be used at tag rules or request naming rules. However, I would like to know how we can get a part of the value.

for example, i have the following variable:

DockerStrippedname=docker/microservice

I would like to get the value of “microservice” as the content of the placeholder to be used in the rule. I don’t know if it could be possible to add a expresion into the placeholder definition {ProcessGroup:dockerstrippedname} to get only this part.

is it possible?

thanks,

Carlos

When using placeholders, if you specify a forward slash (/) before the closing curly-bracket, you can use regex immediately after it. For example:

If your value is  DockerStrippedname=docker/microservice and you want to capture everything after the =, you would enter your placeholder like:

{ProcessGroup:dockerstrippedname/^[^=]*=(.*?$)}

(I’m not too great at regex so there is probably a better way to do that).

Try something like, works !

Tag:

{ProcessGroup:dockerstrippedname/^(.*?)_}

Condition:

^.*?_

Hi,

Thanks a lot!, the following expresion gives me the solution:

/.+\/([^\/]*+)

thanks!

Good  👍!