# Declarative process grouping - what is the format of the detection rule definition condition?

**URL:** <https://community.dynatrace.com/t/declarative-process-grouping-what-is-the-format-of-the-detection-rule-definition-condition/34365>\
**Category:** Open Q&A\
**Tags:** process-groups, oneagent\
**Created:** [March 3, 2022, 2:19pm UTC](https://community.dynatrace.com/t/declarative-process-grouping-what-is-the-format-of-the-detection-rule-definition-condition/34365 "2022-03-03T14:19:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fstekelenburg](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fstekelenburg/32/22029_2.png) [@fstekelenburg](https://community.dynatrace.com/u/fstekelenburg)\
**Post date:** [March 3, 2022, 2:19pm UTC](https://community.dynatrace.com/t/declarative-process-grouping-what-is-the-format-of-the-detection-rule-definition-condition/34365/1 "2022-03-03T14:19:30Z")

</div>

The documentation on the conditions in&nbsp;the Detection rule definition of a&nbsp;Declarative process group is not very elaborate. it is somewhat clear that you do not need to use quotes for the value (e.g. svc&nbsp; in&nbsp;$contains(svc)), but what in situations the arguments contains quotes and spaces?

Especially when it comes to command line arguments, that&nbsp;can be used as property.  
For example this situation, a process is started like:

myprocess.exe -instance"MYUI interface" -domain"c1234"

Questions:

- the command line arguments can contain also (double) quotes. How to deal with quotes?  
$contains(c1234) works. But&nbsp;$contains(-domain"c1234") or&nbsp;$contains(-domain\“c1234\”) do not.

- and when there are spaces?  
It looks like $contains(MYUI interface) works. It doesn’t with quotes.

- does the $eq and $contains look at the whole range of command line arguments, or individual ones?  
Like, should I be able to use for&nbsp;command line arguments:&nbsp;**$eq(-d -p -id=10)**  
Or need these all be separate detection rules?

---

<div class="post-metadata">

**Author:** ![fstekelenburg](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fstekelenburg/32/22029_2.png) [@fstekelenburg](https://community.dynatrace.com/u/fstekelenburg)\
**Post date:** [March 25, 2022, 1:16pm UTC](https://community.dynatrace.com/t/declarative-process-grouping-what-is-the-format-of-the-detection-rule-definition-condition/34365/2 "2022-03-25T13:16:27Z")

</div>

Oke, here is the answer, after a session with One Support, who had to inquire with the responsible team internally as well:

- Quotes -&nbsp;it is possible to use quotes when defining the rules, but the caveat is this:&nbsp;  
If the command line arguments looks like: ./sleep --test=\“aaa\”  
The rule should be $eq(--test=“aaa”)  
But if the command line arguments look like ./sleep --test=“aaa”  
Then the rule should be $eq(--test=aaa)  
_Note: this is a bit tricky and appears reversed. You can see in the definitions through the API that Dynatrace adds the \ to the quotes._
- Spaces - spaces can be used without problem. Taking in account the possible use of quotes above.
- Arguments -&nbsp;every argument needs to go to a different rule

So, to capture the example from the original question above, myprocess.exe -instance"MYUI interface" -domain"c1234", you need to create two rules:

1st rule: $eq(-instance MYUI interface)2nd rule: $eq(-domain c1234)

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 21, 2025, 6:44am UTC](https://community.dynatrace.com/t/declarative-process-grouping-what-is-the-format-of-the-detection-rule-definition-condition/34365/3 "2025-07-21T06:44:46Z")

</div>

[@fstekelenburg](https://community.dynatrace.com/user/21639)&nbsp;need help on&nbsp;similar challenge. My issue explained in more details [here](https://community.dynatrace.com/post/281567#M37078)

Below is the command line argument:

```markup
python service.py -m PROCESS1 -i 0123

```

Do we need to add three rules like below? also is restart of processes needed after creating a rule?

1. $eq(python service.py)
2. $eq(-m process1)
3. $eq(-i 0123)

Regards,  
AK

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 25, 2025, 7:04pm UTC](https://community.dynatrace.com/t/declarative-process-grouping-what-is-the-format-of-the-detection-rule-definition-condition/34365/4 "2025-07-25T19:04:41Z")

</div>

Creating rule for each parameter like below worked.&nbsp;Support helped to depart this challenge.

```markup
$eq(python)
$eq(service.py)
$eq(-m)
$eq(PROCESS1)
$eq(-i)
$eq(0123)

```

Note: Order of rules doesn’t matter

Regards,  
AK
