# Fetch Log Source Names Using DQL Queries

**URL:** <https://community.dynatrace.com/t/fetch-log-source-names-using-dql-queries/52332>\
**Category:** DQL\
**Tags:** dql, logs\
**Created:** [July 3, 2025, 11:43am UTC](https://community.dynatrace.com/t/fetch-log-source-names-using-dql-queries/52332 "2025-07-03T11:43:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PedroDeodato](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pedrodeodato/32/32284_2.png) [@PedroDeodato](https://community.dynatrace.com/u/PedroDeodato)\
**Post date:** [July 3, 2025, 11:43am UTC](https://community.dynatrace.com/t/fetch-log-source-names-using-dql-queries/52332/1 "2025-07-03T11:43:52Z")

</div>

Greetings!

Well, the post subject pretty much sums it put, but what I need is a DQL query to fetch the name of every log source present on a specific host disk.

So, for example, every log source on my environment that begins with “Disk:\Folder1\Folder2”

I have tried to do it but, as the query needed to access every log source to gather this information, the query cost was massive.

Is there any cost-efficient way of achieving this?

Thanks!

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [July 7, 2025, 9:10am UTC](https://community.dynatrace.com/t/fetch-log-source-names-using-dql-queries/52332/2 "2025-07-07T09:10:26Z")

</div>

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

It seems to me that DQL does not support any operator to directly find “all starting with”.  
And it also does not allow grouping or collecting unique values in a single fetch logs query.

However, I might be wrong.

Radek

---

<div class="post-metadata">

**Author:** ![imsingh](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/imsingh/32/7858_2.png) [@imsingh](https://community.dynatrace.com/u/imsingh)\
**Post date:** [July 7, 2025, 9:42am UTC](https://community.dynatrace.com/t/fetch-log-source-names-using-dql-queries/52332/3 "2025-07-07T09:42:23Z")

</div>

Hi there

There is a DQL function which can check if a field startsWith something. Take a look at the following example:

```markup
fetch logs
| filter startsWith(log.source,"C:\\Users" )

```

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [July 7, 2025, 10:18am UTC](https://community.dynatrace.com/t/fetch-log-source-names-using-dql-queries/52332/4 "2025-07-07T10:18:07Z")

</div>

[@imsingh](https://community.dynatrace.com/user/52863)&nbsp;Thanks for the example;)
