# Auto Tag Rule but Modify the Value and Apply the Result

**URL:** <https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881>\
**Category:** Open Q&A\
**Tags:** tagging\
**Created:** [May 23, 2023, 9:06pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881 "2023-05-23T21:06:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [May 23, 2023, 9:06pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/1 "2023-05-23T21:06:11Z")

</div>

Hey everyone, I’m wondering if it is possible to create an auto tagging rule but apply some logic to it to remove some characters and insert a space, then use the result of that for the tag value. My example is below.

original value:  
SERVERENV (via: server)

what i’m hoping to get:  
SERVER ENV

OR i will accept:  
SERVER\ENV

---

<div class="post-metadata">

**Author:** ![tibebe\_m\_digafe](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tibebe\_m\_digafe](https://community.dynatrace.com/u/tibebe_m_digafe)\
**Post date:** [May 24, 2023, 1:01pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/2 "2023-05-24T13:01:16Z")

</div>

Hello,

What you could do for value is limited to a few **predefined “properties”** you can regex on .. or a static value.

Example:

{ProcessGroup:KubernetesNamespace/([^-].+?-.+?)-}

Unfortunately, the kind of functionality you are asking for with additional enhancements would be a very useful feature.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [May 24, 2023, 5:51pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/3 "2023-05-24T17:51:25Z")

</div>

Hi&nbsp;[@tibebe\_m\_digafe](https://community.dynatrace.com/user/32618),

Do you know if that can be applied to tags as [service naming rules](https://www.dynatrace.com/support/help/shortlink/custom-service-names#service-name-format)?

Best regards

---

<div class="post-metadata">

**Author:** ![tibebe\_m\_digafe](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tibebe\_m\_digafe](https://community.dynatrace.com/u/tibebe_m_digafe)\
**Post date:** [June 6, 2023, 9:08pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/4 "2023-06-06T21:08:46Z")

</div>

Hi&nbsp;[@anton](https://community.dynatrace.com/user/2427)

If I understood your question, the example I provided earlier was for auto-tagging.

it will extract the first 2 “words” from k8s namespace (name uses “-” separator)

**xyz-123-crf-456** =\>&nbsp; **xyz-123** (this is then assigned as value for the tag).

 ![tibebe_m_digafe_0-1686085631801.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/6/b693c466dc506e2d2d1b87b8e67c82fd48892378.png)

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [June 6, 2023, 10:18pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/5 "2023-06-06T22:18:53Z")

</div>

Hi,

Yes, I was talking about that. That regex can be applied in more placeholders.

Thank you for your answer!

Best regards

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [June 7, 2023, 12:04pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/6 "2023-06-07T12:04:17Z")

</div>

[@AntonPineiro](https://community.dynatrace.com/user/58682)&nbsp;yes, you can apply it at the naming level, You can also add in strings with regex, Example, you could parse out the first part of the Services String and add in part of the Host Group Name for a Result of “EzTravel Check out - Front End”

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [June 7, 2023, 12:10pm UTC](https://community.dynatrace.com/t/auto-tag-rule-but-modify-the-value-and-apply-the-result/39881/7 "2023-06-07T12:10:44Z")

</div>

Thank you&nbsp;[@ChadTurner](https://community.dynatrace.com/user/14877), yes,&nbsp;[@tibebe\_m\_digafe](https://community.dynatrace.com/user/32618)&nbsp;was able to confirm it to me with his example.

Thank you both, appreciate it&nbsp;:smiling\_face\_with\_sunglasses:
