# Advanced detection rule for process group

**URL:** <https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155>\
**Category:** Open Q&A\
**Tags:** process-groups, settings, processes\
**Created:** [April 4, 2023, 4:08pm UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155 "2023-04-04T16:08:27Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [April 4, 2023, 4:08pm UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/1 "2023-04-04T16:08:27Z")

</div>

Hi Team,

With the advanced process group detection rule, I’m able to get the process groups below  
process-1-1234-ab1c,&nbsp;process-2-5678-xy1z, and so on…

I would like them to be detected as,  
process-1,process-2

There is no option to apply regular expression, only delimits from and to option are present

Can someone help to achieve this?  
Regards,  
AK

---

<div class="post-metadata">

**Author:** ![Tom\_Eaton](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/tom_eaton/32/27852_2.png) [@Tom\_Eaton](https://community.dynatrace.com/u/Tom_Eaton)\
**Post date:** [April 4, 2023, 4:58pm UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/2 "2023-04-04T16:58:29Z")

</div>

Since it’s the name you want to change, could you not use a Process Group Naming Rule -&nbsp;[Process group naming — Dynatrace Docs](https://www.dynatrace.com/support/help/platform-modules/infrastructure-monitoring/process-groups/configuration/pg-naming)

That allows regex

---

<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:** [April 4, 2023, 5:32pm UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/3 "2023-04-04T17:32:48Z")

</div>

[@Tom\_Eaton](https://community.dynatrace.com/user/53035)&nbsp;, Thanks for the response,  
I think, I missed to add that, the process groups ‘process-1-1234-ab1c,&nbsp;process-2-5678-xy1z’ are&nbsp;detected via ‘advanced process group detection rule’ and because this rule, it keeps creating process groups like below,

process-1-1234-ab1c, process-1-3211-fd5j,&nbsp;process-1-3298-vbs5, and so on..

process-2-5678-xy1z, process-2-9845-ab1c, process-2-0121-ret3,&nbsp;and so on..

process-3-8765-xsf1, process-3-6544-q2we, process-3-5890-1aws,&nbsp;and so on..

.

.

.

and so on…

If I use ‘process naming rule’ to exclude content after second hyphen (-) for above process groups then, there will be lot of process groups with same name. If we take example for above case then, after applying process group naming rule it will be like below,

process-1, process-1,&nbsp;process-1, and so on.. (Process group)

process-2, process-2,&nbsp;process-2,&nbsp;and so on.. (Process group)

process-3, process-3,&nbsp;process-3,&nbsp;and so on.. (Process group)

.

.

.

and so on…

So process group naming rules will not help. We need to build a ‘process detection rule’ that will group a processes like below,

process-1 (Process group)

--\> process-1-1234-ab1c, process-1-3211-fd5j,&nbsp;process-1-3298-vbs5, and so on.. (Process group instance)

process-2 (Process group)

--\> process-2-5678-xy1z, process-2-9845-ab1c, process-2-0121-ret3,&nbsp;and so on.. (Process group instance)  
process-3 (Process group)

--\> process-3-8765-xsf1, process-3-6544-q2we, process-3-5890-1aws,&nbsp;and so on.. (Process group instance)

Regards,

AK

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [April 4, 2023, 6:47pm UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/4 "2023-04-04T18:47:56Z")

</div>

Are there any other unique identiefiers within the process? If not perhaps it’s possible to work with an environment variable within the process?

> **[Process group detection](https://docs.dynatrace.com/docs/observe/infrastructure-observability/process-groups/configuration/pg-detection)**
>
> Ways to customize process-group detection

Check the part about environment variables?

---

<div class="post-metadata">

**Author:** ![Romanenkov\_Al3x](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/romanenkov_al3x/32/36257_2.png) [@Romanenkov\_Al3x](https://community.dynatrace.com/u/Romanenkov_Al3x)\
**Post date:** [April 5, 2023, 6:49am UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/5 "2023-04-05T06:49:35Z")

</div>

You can try to use environment variable [DT\_CLUSTER\_ID](https://www.dynatrace.com/support/help/platform-modules/infrastructure-monitoring/process-groups/configuration/pg-detection)=process-1 to skip all built-in \ additional user defined rules.

 ![Romanenkov_Al3x_1-1680677077440.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/4f25c0dfc42729ab313f482007527e0ca9efd11c.png)

We use this approach in k8s - to have no set of rules in the interface and to be able to manage the name of the process group from the yaml manifest by application\infra team.

Or try to use “advanced process group detection rule” with environment variables as&nbsp;[@michiel\_otten](https://community.dynatrace.com/user/4669)&nbsp;replied.

Regards,

Alex Romanenkov

---

<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:** [April 7, 2023, 5:47am UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/6 "2023-04-07T05:47:12Z")

</div>

[@Romanenkov\_Al3x](https://community.dynatrace.com/user/51881), thank you for the response.

Where I can find the variables that are passed, does it show anywhere on Dynatrace console or I have to look into kubernetes.yml?

I’m observing some ‘Kubernetes annotations’ at process group instance level, can we make use of that in detection rule?

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:** [April 7, 2023, 5:55pm UTC](https://community.dynatrace.com/t/advanced-detection-rule-for-process-group/39155/7 "2023-04-07T17:55:17Z")

</div>

Thank you for help and suggestions everyone.  
Well, my colleague help me to do it successfully. Here is how we achieved it.

Created a advanced detection rule to extract process groups with numbers and then created a process group naming rule to give desired names to process groups,

Using 'Advanced detection rule process groups transformed&nbsp;to,

```markup
1 (Process group)
   --> 1, 1, 1, and so on.. (Process group instance)
2 (Process group)
   --> 2, 2, 2, and so on.. (Process group instance)
3 (Process group)
   --> 3, 3, 3, and so on.. (Process group instance)
.
.
and so on...

```

Applied process group naming rule to make it like below,

```markup
process-1 (Process group)
   --> process-1, process-1, process-1, and so on.. (Process group instance)
process-2 (Process group)
   --> process-2, process-2, process-2, and so on.. (Process group instance)
process-3 (Process group)
   --> process-3, process-3, process-3, and so on.. (Process group instance)
.
.
and so on...

```

Regards,

AK
