18 Feb 2026 11:47 AM
Hi,
I'm having trouble understanding the DPL documentation. What I want to do is extract the last characters after a certain character, in this case it would be '/'. I am trying to extract just the filename from the string. For example,
I would just want input.csv from the following filepath/string:
/NODEA12XY/data/services/svc_rt/module/xxabc/3.4.7/in/input.csv
Solved! Go to Solution.
18 Feb 2026 12:55 PM - edited 18 Feb 2026 12:57 PM
You can achieve this with the "substring" and "lastindexof" function, https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/string-functions#s... , https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/string-functions#l...
data record(content = "/NODEA12XY/data/services/svc_rt/module/xxabc/3.4.7/in/input.csv"),
record(content = "/NODEA12XY/data/services/input2.csv"),
record(content = "/NODEA12XY/input3.csv")
| fieldsAdd FileName = substring(content, from:lastIndexOf(content, "/") + 1)Try and let us know.
Featured Posts