question

Masashi I. avatar image
Masashi I. asked ·

Transformation Regex to modify value "1 2 3" into "1,2,3"

I would like to modify URL parameter value such as "1 2 3" into "1,2,3."

 

Assume threre is a URL parameter just like below.

http://localhost:18081/xxx?param1=1%202%203

 

When dynaTrace catches the parameter value of param1, it is "1 2 3."

I would like to translform it into "1,2,3" by replacing the space into comma.

 

I assume I need to use Transformation Regex to do that but not quite sure how I exactly do. So, I need your help.

 

I appreciate your comments/suggestion.

Thank you.

business transaction
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Reinhard B. avatar image
Reinhard B. answered ·

Sorry, you can't use regexes for a replacement functionality or string modifications that way.
The only thing that works is concatenating multiple matches/references separated by spaces:

e.g.: 1,2,3 => ([0-9]+),([0-9]+),([0-9]+) => 1 2 3

As described in the hint text:

Optionally enter a transformation regular expression to extract relevant information. The resulting value will be the tagged expression or, if more expressions are present, the combination of all tagged expressions separated with a blank. Sample: Regex "ID=(.*)" and input "ID=66" will result in a value of "66". Regex "ID=([^_]*)_[^_]*_(.*)" and input "ID=66_867_07" will result in a value of "66 07".

 

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Masashi I. avatar image
Masashi I. answered ·

 

It is good to know the limitation correctly.

So, thank you so much!

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.