# DQL Query joining Logs on Spans not Returning Results

**URL:** <https://community.dynatrace.com/t/dql-query-joining-logs-on-spans-not-returning-results/51227>\
**Category:** DQL\
**Tags:** dql, logs\
**Created:** [April 14, 2025, 8:06pm UTC](https://community.dynatrace.com/t/dql-query-joining-logs-on-spans-not-returning-results/51227 "2025-04-14T20:06:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GPtheSQL](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@GPtheSQL](https://community.dynatrace.com/u/GPtheSQL)\
**Post date:** [April 14, 2025, 8:06pm UTC](https://community.dynatrace.com/t/dql-query-joining-logs-on-spans-not-returning-results/51227/1 "2025-04-14T20:06:05Z")

</div>

I am trying to find all logs for traces with a certain name using DQL. I discovered in notebooks that spans has the name I am looking for in a column called&nbsp; **endpoint.name** &nbsp;as such, I believed the below query would work:

```java
fetch logs
|join [
fetch spans 
|filter contains(endpoint.name, "INSERT_TRACE_NAME_HERE")
],
    on: { left[trace_id] == right[trace.id] }

```

Unfortunately, this query returns no results. I confirmed the subquery returns results for my desired endpoint name and the super query returns the logs I am looking for if I filter for one of the trace id’s returned in the subquery.&nbsp; Anyone know what I’m doing wrong here? Please let me know if you need any more information.

---

<div class="post-metadata">

**Author:** ![yanezza](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yanezza/32/5036_2.png) [@yanezza](https://community.dynatrace.com/u/yanezza)\
**Post date:** [April 17, 2025, 10:49am UTC](https://community.dynatrace.com/t/dql-query-joining-logs-on-spans-not-returning-results/51227/2 "2025-04-17T10:49:50Z")

</div>

Hi!  
the trace.id is a UID and the trace\_id is a string, you need to convert it (or the trace\_id to UID or the trace.id to String)

 ![yanezza_0-1744886977321.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/f/9f22535579e5958a8a6f833a4f76b62fea2e55f9.png)
