# Need Help with String Extraction in DPL

**URL:** <https://community.dynatrace.com/t/need-help-with-string-extraction-in-dpl/52144>\
**Category:** DQL\
**Tags:** dpl\
**Created:** [June 17, 2025, 10:44pm UTC](https://community.dynatrace.com/t/need-help-with-string-extraction-in-dpl/52144 "2025-06-17T22:44:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jmarbaix](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jmarbaix](https://community.dynatrace.com/u/jmarbaix)\
**Post date:** [June 18, 2025, 8:43am UTC](https://community.dynatrace.com/t/need-help-with-string-extraction-in-dpl/52144/3 "2025-06-18T08:43:31Z")

</div>

DPL is only for extraction, not for adapting the string itself. You need to compare it to regular expressions. This means that if you want to do more than just matching/searching and extracting a string, you will need a DQL statement.

A solution with DPL could be:

```auto
DATA record(host.name="dappdevgw-001.phx.ad.company.com", message= "this is a test message 1"),
record(host.name="pappdevgw-006.phx.ad.company.com", message= "this is a test message 2"),
record(host.name="bappdevgw-007.phx.ad.company.com", message= "this is a test message 3")
| parse `host.name`, """DATA?
(DATA{1}
'appdevgw-'
DATA{3}):HostName
DATA"""
| fieldsAdd HostName = upper(HostName)

```

---

_[View the full topic](https://community.dynatrace.com/t/need-help-with-string-extraction-in-dpl/52144)._
