# How do I get the last values of a string using the parse command?

**URL:** <https://community.dynatrace.com/t/how-do-i-get-the-last-values-of-a-string-using-the-parse-command/55033>\
**Category:** DQL\
**Tags:** dql, davis, notebooks, dpl\
**Created:** [February 18, 2026, 11:47am UTC](https://community.dynatrace.com/t/how-do-i-get-the-last-values-of-a-string-using-the-parse-command/55033 "2026-02-18T11:47:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![badgerfifteen](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@badgerfifteen](https://community.dynatrace.com/u/badgerfifteen)\
**Post date:** [February 18, 2026, 11:47am UTC](https://community.dynatrace.com/t/how-do-i-get-the-last-values-of-a-string-using-the-parse-command/55033/1 "2026-02-18T11:47:23Z")

</div>

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:

```markup
/NODEA12XY/data/services/svc_rt/module/xxabc/3.4.7/in/input.csv

```

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [February 18, 2026, 12:55pm UTC](https://community.dynatrace.com/t/how-do-i-get-the-last-values-of-a-string-using-the-parse-command/55033/2 "2026-02-18T12:55:48Z")

</div>

Hi&nbsp;[@badgerfifteen](https://community.dynatrace.com/user/67521)

You can achieve this with the “substring” and “lastindexof” function,&nbsp;[String functions — Dynatrace Docs](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/string-functions#substring)&nbsp;,&nbsp;[String functions — Dynatrace Docs](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/string-functions#lastIndexOf)

```markup
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.
