# Is there any chance for use "AND" logic in conditions for Custom service metrics?

**URL:** <https://community.dynatrace.com/t/is-there-any-chance-for-use-and-logic-in-conditions-for-custom-service-metrics/21038>\
**Category:** Open Q&A\
**Tags:** request-attributes\
**Created:** [December 14, 2020, 9:55am UTC](https://community.dynatrace.com/t/is-there-any-chance-for-use-and-logic-in-conditions-for-custom-service-metrics/21038 "2020-12-14T09:55:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romanenkov\_Alex](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_alex/32/27497_2.png) [@Romanenkov\_Alex](https://community.dynatrace.com/u/Romanenkov_Alex)\
**Post date:** [December 14, 2020, 9:55am UTC](https://community.dynatrace.com/t/is-there-any-chance-for-use-and-logic-in-conditions-for-custom-service-metrics/21038/1 "2020-12-14T09:55:32Z")

</div>

I have request attribute.

It can have values: 101, 102, 103.

Why I can`t create metric - I Want to count requests with request attrubute 101 or 102.

I can`t tell to Dynatrace - to count requests that have 101 or 102…

 ![27568-1607939176622.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/1/4145e2b5aedeb40036ad7de44edcddfb89801c6e.png)

This metric will not work because we can`t add additional logic in to condition like we have in AppMon. We have no “AND” or “OR”…

Condition will work if we have in query 102 and 101… But it is impossible.

 ![27590-1607939305394.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/e06220c2b57e656de483e201bd395ee04c558d7b.png)

There is no way to create metric from Multi dimensionnal analysis view.

I can`t choose in filter request attrubute “query” twice.

 ![27569-1607939620808.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/b2a5887b8061fac7b10a7898e2f05318eb0df938.png)

In AppMon we can have unlimited mesures and unlimited business transactions.

In Dynatrace we have problem with simple metrics like in my example.

Regards,

Alexander

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [December 14, 2020, 10:44am UTC](https://community.dynatrace.com/t/is-there-any-chance-for-use-and-logic-in-conditions-for-custom-service-metrics/21038/2 "2020-12-14T10:44:12Z")

</div>

You have your Regular expression wrong. For performance reasons of regular expressions, you can only have atomic groups. Thus your filter should look like this:

```auto
(?>101|102)

```

This will match if the value contains either 101 or 102.

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Alex](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_alex/32/27497_2.png) [@Romanenkov\_Alex](https://community.dynatrace.com/u/Romanenkov_Alex)\
**Post date:** [December 14, 2020, 11:12am UTC](https://community.dynatrace.com/t/is-there-any-chance-for-use-and-logic-in-conditions-for-custom-service-metrics/21038/3 "2020-12-14T11:12:09Z")

</div>

Julius, thank you for fast response.
