# Splitting a service by "URL\_HOST\_NAME"

**URL:** <https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604>\
**Category:** Open Q&A\
**Tags:** dynatrace-api\
**Created:** [January 12, 2024, 3:20pm UTC](https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604 "2024-01-12T15:20:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [January 12, 2024, 3:20pm UTC](https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604/1 "2024-01-12T15:20:09Z")

</div>

I have been splitting services by several techniques, according to  
[https://community.dynatrace.com/t5/Open-Q-A/Is-it-possible-to-split-a-service/m-p/121066](https://community.dynatrace.com/post/121066)

Strangely today I was trying to split a “FULL\_WEB\_REQUEST” service by the URL hostname, and it seems it’s not possible. While it seems that it’s possible to do this with “Public network services” and “Unmonitored hosts”, it doesn’t seem to be possible with “FULL\_WEB\_REQUEST”.

The best approximation I have managed is to do it through a condition, with something like:

```markup
{
"attributeType": "URL_HOST_NAME",
"compareOperations": [
{
"type": "STARTS_WITH",
"negate" : false,
"ignoreCase" : "true",
"values" : ["www001.site.pt"] }
] }

```

but I need to do it for some 80 conditions, and it wouldn’t be dynamic…

Any ideas?

---

<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:** [January 14, 2024, 8:17pm UTC](https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604/2 "2024-01-14T20:17:56Z")

</div>

[@AntonioSousa](https://community.dynatrace.com/user/17213)&nbsp;Not sure about the reason (probably since the rules are evaluated differently for outgoing where you have only the client side monitored), but it’s not in general a recommended approach due to possible volatility.

If you have like 80+ conditions, it’s a good way to use monaco to define the detection rules as it now supports [proper templating](https://docs.dynatrace.com/docs/shortlink/configuration-as-code-advanced-use-case#advanced-use-case-list-of-key-value-pairs). And you can define it then with a simple list.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [January 14, 2024, 8:48pm UTC](https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604/3 "2024-01-14T20:48:26Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364),

Thanks for the answer. Looks like I’m going to put in a product idea (it’s here: [https://community.dynatrace.com/t5/Product-ideas/Split-a-quot-FULL-WEB-REQUEST-quot-service-by-the-URL-hostname/idi-p/234288](https://community.dynatrace.com/post/234288) ), as this is only a temporary solution, as the hostnames involved might increase with time.

In the meantime, I was doing it through the API, but now I have discovered that you can also do it through the UI:

> **[Configure service detection rules in Service Detection v1](https://docs.dynatrace.com/docs/observe/application-observability/services/service-detection/service-detection-v1/customize-service-detection)**
>
> Use detection rules to customize and enhance the automated detection of your services.

---

<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:** [January 14, 2024, 9:14pm UTC](https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604/4 "2024-01-14T21:14:41Z")

</div>

UI has been there for more than a year (probably two), but for more complex scenarios such as 80+ rules. I always prefer to do it as code. Manually typing dozens of rules is error-prone.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [January 14, 2024, 11:42pm UTC](https://community.dynatrace.com/t/splitting-a-service-by-url-host-name/43604/5 "2024-01-14T23:42:33Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364),

Have always done it API way, so not difficult to do all of them.

Also figured out that you cannot do some of the configs in the UI…
