# DPL expressions for web address with port

**URL:** <https://community.dynatrace.com/t/dpl-expressions-for-web-address-with-port/51063>\
**Category:** DQL\
**Tags:** openpipeline, dql, dpl\
**Created:** [April 3, 2025, 11:59pm UTC](https://community.dynatrace.com/t/dpl-expressions-for-web-address-with-port/51063 "2025-04-03T23:59:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![triptisharma](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@triptisharma](https://community.dynatrace.com/u/triptisharma)\
**Post date:** [April 3, 2025, 11:59pm UTC](https://community.dynatrace.com/t/dpl-expressions-for-web-address-with-port/51063/1 "2025-04-03T23:59:53Z")

</div>

Hello Everyone,

I am trying to find a pattern to match a web address and a port number in the content of a log. For example the log will contain

This is a test message for [http://ltest-bed.trigun.org](http://ltest-bed.trigun.org) for a system **[test-bed.trigun.org](http://test-bed.trigun.org)**:443. Tunnel id account:///test/locat

I want to be able to match the content in bold. The port number of the org keeps varying and also sometimes the system comes enclosed in a quote for example

**log 1:** This is a test message for [http://ltest-bed.trigun.org](http://ltest-bed.trigun.org) for a system \“**[test-bed.trigun.org](http://test-bed.trigun.org)**:443\”. Tunnel id account:///test/locat

The log might also come in the format

**log 2:** This is a test message for a system “**[test-bed.trigun.org](http://test-bed.trigun.org)**:443”. Tunnel id account:///test/locat  
any suggestions please ?

I tried this&nbsp;[a-zA-Z0-9.-]\*:host’:'[0-9]\*:port but that did not work because it would also match http: rather than the webaddress:port

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [April 4, 2025, 2:27am UTC](https://community.dynatrace.com/t/dpl-expressions-for-web-address-with-port/51063/2 "2025-04-04T02:27:43Z")

</div>

Your current pattern has the port number digits as optional, where the ‘\*’ quantifier means “match zero or more”. This causes the pattern to match on HTTP. Replace the ‘\*’ with a ‘+’ sign to make it mandatory, as seen in the example below.

```javascript
data record(content="This is a test message for http://ltest-bed.trigun.org for a system \"test-bed.trigun.org:443\". Tunnel id account:///test/locat")
| parse content, "LD ([a-zA-Z0-9.-]*:host':'[0-9]+:port) LD"

```

---

<div class="post-metadata">

**Author:** ![triptisharma](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@triptisharma](https://community.dynatrace.com/u/triptisharma)\
**Post date:** [April 4, 2025, 4:46pm UTC](https://community.dynatrace.com/t/dpl-expressions-for-web-address-with-port/51063/3 "2025-04-04T16:46:00Z")

</div>

Thank you Marco!
