# Extract Text from Content Using REGEX in DQL Queries

**URL:** <https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224>\
**Category:** DQL\
**Tags:** regex, dql\
**Created:** [October 9, 2024, 6:24am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224 "2024-10-09T06:24:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanawat](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thanawat](https://community.dynatrace.com/u/thanawat)\
**Post date:** [October 9, 2024, 6:24am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224/1 "2024-10-09T06:24:41Z")

</div>

I have this message “Exception org.springframework.web.servlet.resource.NoResourceFoundException”.

I want to find the latest section of this message which is “ **NoResourceFoundException** ”.  
I prefer to find the text after latest “.” dot.

Can I do this?

---

<div class="post-metadata">

**Author:** ![DynaWiz](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@DynaWiz](https://community.dynatrace.com/u/DynaWiz)\
**Post date:** [October 9, 2024, 6:47am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224/2 "2024-10-09T06:47:10Z")

</div>

Try use this regex:

.+\.(.+)$

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [October 9, 2024, 7:41am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224/3 "2024-10-09T07:41:38Z")

</div>

Hi&nbsp;[@thanawat](https://community.dynatrace.com/user/57470)&nbsp;  
you can create a query to return the value after “.”

or create a rule to fetch exact message in the exception after “.”

BR,

Peter

---

<div class="post-metadata">

**Author:** ![thanawat](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@thanawat](https://community.dynatrace.com/u/thanawat)\
**Post date:** [October 9, 2024, 7:49am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224/4 "2024-10-09T07:49:17Z")

</div>

Hi&nbsp;[@DynaWiz](https://community.dynatrace.com/user/4080)&nbsp;,&nbsp;[@Peter\_Youssef](https://community.dynatrace.com/user/51369)&nbsp;  
thank for your suggestion. Could you share the link for the solution that you mention?  
I mean how to use regex with DQL or example query to get expected value.

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [October 9, 2024, 8:16am UTC](https://community.dynatrace.com/t/extract-text-from-content-using-regex-in-dql-queries/48224/5 "2024-10-09T08:16:11Z")

</div>

Hello&nbsp;[@thanawat](https://community.dynatrace.com/user/57470)

10 - 15 Minutes reading and you will be able to develop it

1. [DQL](https://docs.dynatrace.com/docs/shortlink/dql-dynatrace-query-language-hub)
2. [DQL Commands](https://docs.dynatrace.com/docs/shortlink/dql-commands-overview)
3. [How to use DQL queries](https://docs.dynatrace.com/docs/shortlink/dql-use-queries)

KR,

Peter
