cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

regex help: 2nd URL part, only for 2-part URLs

sxsaxena
Participant

We have some URLs that we need to capture using Appmon. The URLs are basically: www.website.com/acp/myurl Basically, anything that has no additional /levels after acp/level1

There will be plenty of other URLs in the data like /acp/level1/level2/level3 etc.

The URls i'm trying to capture can have letters, numbers, and dashes (because there are dates). here are the types of URLs I want to capture. Basically anything that has only 1 part after the initial /acp/ part.

https://www.aciaagent.com/acp/acg-secured-sites-new

https://www.aciaagent.com/acp/marketing-resources

https://www.aciaagent.com/acp/sales-compensation-08-14-2015

https://www.aciaagent.com/acp/auto

https://www.aciaagent.com/acp/membership

https://www.aciaagent.com/acp/homeowner

5 REPLIES 5

janusz_dabrowsk
Dynatrace Pro
Dynatrace Pro

Hi, try

https?:\/\/[^\/]*\/[^\/]*\/([^\/]*)$

jason_westerho1
Inactive

If https://www.aciaagent.com/acp/ is always the same, why not do:?

[https://www.aciaagent.com/](acp\/[^\/]*)$

There's no just single answer. I provided as generic as possible solution to the "regex help: 2nd URL part, only for 2-part URLs". Some people / machines will sometimes go through https://204.78.172.152/acp/something instead as live learns.

sxsaxena
Participant

I'm making this using web request URI value business transaction. I was going to filter on this and also use it as a splitting value to get the desired output.

im I correct to assume that the web request URI value filter/splitting wont even look at the fqdn portion? So wont all of my inputs simply start with /acp/[stuff/stuff/stuff] as opposed to https..../stuff?

Correct Shrimant, when using web requests - URI pattern value, fqdn will not be considered. If you're only concerned with the URI path and not the domain that measure should be fine. You can use a regex very similar to what was provided minus the domain, like

/acp/([^/]*$)


Which will match on any of the URI paths you provided and reject anything with any further levels in the path. It will also capture level 2 of the URI in case you want to use it for a splitting value or something. I don't think escaping the forward slashes is needed by the AppMon regex interpreter but it also would not hurt.