05 Sep 2024 12:53 PM
06 Sep 2024 02:57 AM
There is an example in the docs , is this what you are after ?
https://docs.dynatrace.com/docs/shortlink/string-functions#replaceString
data record(content = "DQL is awesome!"),
record(content = "Dynatrace Query Language"),
record(content = "abcabca")
| fieldsAdd replaceString(content, "awesome", "simple"),
replaceString(content, "abca", "xyz")
12 May 2025 08:53 PM - edited 13 May 2025 11:40 AM
Did you figure out the solution for this ??
I have the similar requirement with the expression(where substrings should be replaced) is having two different substrings.
For Ex: Category field has two results either A or B and I want to replace 'A' with 'XML' and 'B' with 'TEXT'. I used below command and it worked for A. How do I replace the the another string B in the same Category field(without adding new fieldsAdd command.)
fieldsAdd replaceString(Category, "A", "XML")
Thanks,