# why do matchesValue and matchesPhrase give different results in this case?

**URL:** <https://community.dynatrace.com/t/why-do-matchesvalue-and-matchesphrase-give-different-results-in-this-case/44772>\
**Category:** DQL\
**Tags:** dql\
**Created:** [March 20, 2024, 8:14pm UTC](https://community.dynatrace.com/t/why-do-matchesvalue-and-matchesphrase-give-different-results-in-this-case/44772 "2024-03-20T20:14:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GerryIsHere](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerryishere/32/15590_2.png) [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Post date:** [March 20, 2024, 8:14pm UTC](https://community.dynatrace.com/t/why-do-matchesvalue-and-matchesphrase-give-different-results-in-this-case/44772/1 "2024-03-20T20:14:15Z")

</div>

Here are two queries, I don’t understand why the results are different (same time period 24 hours):

fetch logs  
| filter **matchesPhrase** (host.name, “tar04\*”)  
| summarize collectDistinct(host.name)

tar045.dcmax.local  
tar046.dcmax.local

fetch logs  
| filter **matchesValue** (host.name, “tar04\*”)  
| summarize collectDistinct(host.name)

tar040.dcmax.local  
tar041.dcmax.local  
tar045.dcmax.local  
tar046.dcmax.local

---

<div class="post-metadata">

**Author:** ![cesarsaravia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/cesarsaravia/32/12818_2.png) [@cesarsaravia](https://community.dynatrace.com/u/cesarsaravia)\
**Post date:** [March 20, 2024, 8:39pm UTC](https://community.dynatrace.com/t/why-do-matchesvalue-and-matchesphrase-give-different-results-in-this-case/44772/2 "2024-03-20T20:39:37Z")

</div>

Hi&nbsp;[@GerryIsHere](https://community.dynatrace.com/user/72301)&nbsp;  
The only difference between those functions are the validations that _matchesPhrase_ realizes.

 ![cesarsaravia_0-1710967005996.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/8/f8e395a42601d02eb2be3b64d97798a63755e524.png)

Tried to replicate your scenario with the same data, and in both cases the result is the same.

 ![cesarsaravia_1-1710967134116.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/ed64bf965124eb4ff890f3abfd4826d55dbb59d0.png)

Could you get us more context?  
Regards,

---

<div class="post-metadata">

**Author:** ![GerryIsHere](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerryishere/32/15590_2.png) [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Post date:** [March 20, 2024, 8:44pm UTC](https://community.dynatrace.com/t/why-do-matchesvalue-and-matchesphrase-give-different-results-in-this-case/44772/3 "2024-03-20T20:44:20Z")

</div>

the logs are from WebLogic servers, I think there is 1-2 million logs a day. If I run the queries just counting the number of logs matchesPhrase finds way fewer logs. The host.names are exactly as shown.

---

<div class="post-metadata">

**Author:** ![GerryIsHere](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gerryishere/32/15590_2.png) [@GerryIsHere](https://community.dynatrace.com/u/GerryIsHere)\
**Post date:** [March 20, 2024, 8:45pm UTC](https://community.dynatrace.com/t/why-do-matchesvalue-and-matchesphrase-give-different-results-in-this-case/44772/4 "2024-03-20T20:45:20Z")

</div>

doesn’t support mid-string wildcards, except some of the time when it does apparently!
