# DQL matcher in business events

**URL:** <https://community.dynatrace.com/t/dql-matcher-in-business-events/43368>\
**Category:** DQL\
**Tags:** dql, business-events\
**Created:** [December 26, 2023, 10:14pm UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368 "2023-12-26T22:14:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [December 26, 2023, 10:14pm UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368/1 "2023-12-26T22:14:24Z")

</div>

Hello, how do you use “DQL matcher in business events” when it is necessary to compare a number?

for example:

 ![Ellery_0-1703628710862.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/1/e1a24ee8eb4cbf9fcfb0c9b95a2aa2f9a4e25e90.png)

and “matchesPhrase(toString(step), “1002”)” works

 ![Ellery_1-1703628795094.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/bf0af61dcc02360b09d9271488f98057819589a3.png)

but

 ![Ellery_2-1703628849183.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/b/3b4d4a52f450406ee51caf5f02add90931400558.png)

---

<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:** [December 26, 2023, 11:12pm UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368/2 "2023-12-26T23:12:18Z")

</div>

Hi&nbsp;[@Ellery](https://community.dynatrace.com/user/65321)&nbsp;  
You should convert the string field “step” to double. You can use toDouble() function to convert to numbers with decimals, because your data is pure string.  
Here you have an example:

 ![cesarsaravia_0-1703632200572.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/0/40dd088e6eb08585ce6164e486bd8f97d5e00b8a.png)

```markup
data 
  record(timestamp=now()-1m, severity="INFO", event="search successful", number= "10"),
  record(timestamp=now()-1m, severity="INFO", event="search successful", number= "10.1"), 
  record(timestamp=now(), severity="ERROR", event="failed to find product", number= "15.5"),
  record(timestamp=now()-1m, severity="INFO", event="search successful", number= "15.6"), 
  record(timestamp=now(), severity="ERROR", event="failed to find product", number= "5.4")
| filter toDouble(number)>=10 and toDouble(number) <= 20.9
| fieldsAdd success=if(contains(event,"success"),true)

```

BR,  
-Cesar S.

---

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [December 27, 2023, 2:01am UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368/3 "2023-12-27T02:01:20Z")

</div>

This works excellently in LOGS and Event

s,&nbsp;

 ![Ellery_0-1703642219784.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/eb575ade322ff1dd5ec382b5ebc080bf71938b89.png)

but when we go to “ **Business event metric extraction** ”

 ![Ellery_1-1703642351766.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/f/bf6b7812708ce2a3ea8f9e113094e62eeb98725e.png)

in this only acepts&nbsp;matchesPhrase and&nbsp;matchesValue

---

<div class="post-metadata">

**Author:** ![Ellery](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Ellery](https://community.dynatrace.com/u/Ellery)\
**Post date:** [December 27, 2023, 2:23am UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368/4 "2023-12-27T02:23:44Z")

</div>

i found the solution, almost acepts “==” equals for numbers

the query it’s “matchesPhrase(event.type, “resultado admision”) and matchesPhrase(event.provider, “prod.salud.achs.cl”) and (step == 1002 or step == 1002.1 or step == 1002.2 or step == 1002.3 or step == 1002.4 or step == 1002.5)”

---

<div class="post-metadata">

**Author:** ![Ana.Kuzmenchuk](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Ana.Kuzmenchuk](https://community.dynatrace.com/u/Ana.Kuzmenchuk)\
**Post date:** [December 28, 2023, 1:25pm UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368/5 "2023-12-28T13:25:04Z")

</div>

Thank you for sharing your findings with the Community; highly appreciated!

---

<div class="post-metadata">

**Author:** ![itamarmesa](https://avatars.discourse-cdn.com/v4/letter/i/3ec8ea/32.png) [@itamarmesa](https://community.dynatrace.com/u/itamarmesa)\
**Post date:** [April 11, 2024, 11:07am UTC](https://community.dynatrace.com/t/dql-matcher-in-business-events/43368/6 "2024-04-11T11:07:50Z")

</div>

I find that useful, however, I don’t feel like adding 100 ors in case, of, f.e. a response code, 5xx, I did something different:

Captured the response normally, then added a new field of the converted response code to a string in Processing with

FIELDS\_ADD(rescodeString:“”+rescode)

and added a filter to the business event metric capture:

matchesValue(rescodeString,“5\*”)

Probably, there is a better option to do this.

But replacing DQL Matchers with actual DQL would be the best, since It is practically unusable.
