# Web request clean URL rule not working as intended

**URL:** <https://community.dynatrace.com/t/web-request-clean-url-rule-not-working-as-intended/20082>\
**Category:** Open Q&A\
**Tags:** services-classic\
**Created:** [March 21, 2019, 3:30pm UTC](https://community.dynatrace.com/t/web-request-clean-url-rule-not-working-as-intended/20082 "2019-03-21T15:30:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam\_sjoerdsma](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_sjoerdsma/32/15312_2.png) [@adam\_sjoerdsma](https://community.dynatrace.com/u/adam_sjoerdsma)\
**Post date:** [March 21, 2019, 3:30pm UTC](https://community.dynatrace.com/t/web-request-clean-url-rule-not-working-as-intended/20082/1 "2019-03-21T15:30:22Z")

</div>

Hi,

My customer wants me to try and cleanup the requests in Dynatrace for a number of the services in their monitored applications.

I tried to test the URL Cleanup rule for one of the requests, but the results were not what I expected.

The example that I was testing on, was for a number of requests in a service that are formatted similar to the below example.

**Example Request:**

/prweb/PRServlet/MIEk-3UAC9M7mlVhvTQdsLg84mofwl7BL0nrQpWhKBg%5B\*/!STANDARD

The goal from my customer, is to remove/mask the string of characters that start with **MIEk** and end right before the “ **/** ”

**Example Request (Part that should be masked in bold)**

/prweb/PRServlet/ **MIEk-3UAC9M7mlVhvTQdsLg84mofwl7BL0nrQpWhKBg%5B\*** /!STANDARD

They would like to see these kinds of requests cleaned up so that they look like the example below.

**Desired Output Example:**

/prweb/PRServlet/\*/!STANDARD

I attempted to perform this by adding a cleanup rule, however when I checked the requests, they all were being renamed with just a **/**

![20070-test-url-cleanup-regex.png](https://global.discourse-cdn.com/dynatrace/original/2X/c/caad41fcd133097653e1fe7a666fa52779ca683e.png)

**Results:**

 ![20069-bad-url-name-example.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/8/2862eef48f8ce15d95cd7f9c92a0b576a5101b3a.png)

Does anyone know what I did wrong with my rule, and how I can properly implement this?

Thanks,

Adam Sjoerdsma

---

<div class="post-metadata">

**Author:** ![david\_n](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/david_n/32/12978_2.png) [@david\_n](https://community.dynatrace.com/u/david_n)\
**Post date:** [March 21, 2019, 7:41pm UTC](https://community.dynatrace.com/t/web-request-clean-url-rule-not-working-as-intended/20082/2 "2019-03-21T19:41:34Z")

</div>

Hello Adam,

Try this regex: (MIEk).\*[\/]

```auto
Then you can replace it with: \*\/

```

Note: there is a backslash in front of the \* but it is not showing up in the replacement regex.

Let me know if that works

 ![20076-2019-03-21-14-40-27-online-regex-tester-and-debugg.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/e/1e80c4e4ae56cba1b4d63728401a13b22696dbb8.png)

Thanks,

David Nicholls

---

<div class="post-metadata">

**Author:** ![adam\_sjoerdsma](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_sjoerdsma/32/15312_2.png) [@adam\_sjoerdsma](https://community.dynatrace.com/u/adam_sjoerdsma)\
**Post date:** [March 21, 2019, 8:44pm UTC](https://community.dynatrace.com/t/web-request-clean-url-rule-not-working-as-intended/20082/3 "2019-03-21T20:44:01Z")

</div>

Thanks David! This helped me better understand how the regex needed to be applied.
