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

Configuring regular expression for URL parameter in DCRUM.

akshay_shinde2
Inactive

Hello,

I'm defining URL parameter under "URL monitoring" tab & want to report only some part of parameter to CAS.

String to process:-

param=266%2FGetTableEntryList%2F12%2Fxy-abcd-xyz28%2FAST%3AAsset%20Management%20Console10%2FManagement9%2F%2Fxy-abcd-xyz18%2FAST%3AComputerSystem0%2F1%27%20%3D%22BMC_COMPUTERSYSTEM%22)5%2F1%2F1%2F45%2F1%2F1%2F11%2F12%2F0%2F2%2F0%2F

Below is the expression I'm using,

(param=\d+[^/]*BMC_COMPUTERSYSTEM)

AMD output:-

param=266%2FGetTableEntryList%2F12%2Fxy-abcd-xyz28%2FAST%3AAsset%20Management%20Console10%2FManagement9%2F%2Fxy-abcd-xyz18%2FAST%3AComputerSystem0%2F1%27%20%3D%22BMC_COMPUTERSYSTEM

But desired result is,

param=266BMC_COMPUTERSYSTEM

Can somebody help me to achieve this.

BR,
Ak

10 REPLIES 10

Erik_Soderquist
Dynatrace Pro
Dynatrace Pro

DCRUM uses the () to indicate what to report, so in your example, you would need two separate sets of () rather than a single set

I believe:

(param=\d+)[^/]*(BMC_COMPUTERSYSTEM)

will get you the results you are looking for

-- Erik

Hi Erik,

I tried with that one as well earlier but somehow it is not reporting to the CAS.

For some other application I'm following the same configuration & URL's are reporting perfectly to the CAS.

Like,

URL to process,

https://xyz.domain.com/portal?NavigationTarget...

RegEx,

(TarTitle=[^&]*)

Reported URL,

https://xyz.domain.com/portal?tartitle=view additional employee data

I'm looking for something like above.
Is there anything I'm missing here in configuration?

BR,

AK

john_leight
Dynatrace Pro
Dynatrace Pro

If we decode the ASCII we get

param=266/GetTableEntryList/12/xy-abcd-xyz28/AST:Asset Management Console10/Management9//xy-abcd-xyz18/AST:ComputerSystem0/1' ="BMC_COMPUTERSYSTEM

so I think the regex you may be after is:

(param=[^/]*)/[^\"]*\"(BMC_COMPUTERSYSTEM)

This will get everything before the first / and then skip everything to the ", process the " and then select everything after the ".

I'm not sure if you need to escape the " with \" - you may be able to just use " there.

john_leight
Dynatrace Pro
Dynatrace Pro

Have you tried editing the service using the wizard? One of the wizard steps is to specify URLs to monitor. It lets you select and test what you setup against recorded traffic.

You may need to specify URL encoding as one of the transforms in the url monitoring definition.

Hi John,

I don't know what's wrong happening with my RUM console.

It is showing 0 hits for every recording (in wizard) & even for "Automatic".

One of our AMD is giving an error (CBA agent can not communicate with CBA) when I tried to record new trace for the application.

I think I have to take this up with support now.

I will check for your suggestion & get back to you. Thanks.

BR,

AK

I checked that option but is it saying "No matching results were found".

BR,

Ak

janusz_dabrowsk
Dynatrace Pro
Dynatrace Pro

I think you should add step to URL decode it first. so you will get:

param=266/GetTableEntryList/12/xy-abcd-xyz28/AST:Asset Management Console10/Management9//xy-abcd-xyz18/AST:ComputerSystem0/1' ="BMC_COMPUTERSYSTEM")5/1/1/45/1/1/11/12/0/2/0/

What parameter from this you want to extract exactly ?

Yes I have to write the regex by considering the decoded URL.

When I checked for resulted URL's on CAS, they were already in decoded form.

I have written below expression to achieve the desired result.

(param=[^/]*/).+(BMC_COMPUTERSYSTEM).*

Does it needs to be further enhanced so as to avoid overhead on processing?

BR,

Ak

Is BMC_COMPUTERSYSTEM some constant value that needs to be always reported ? Can't it be anything else or it has to be exactly MC_COMPUTERSYSTEM as you decided ?

If former use

(param=[^\/]*)[^=]*="(BMC_COMPUTERSYSTEM)

if latter

(param=[^\/]*)[^=]*="([^"]*)

Hi Janusz,

Thanks for your suggestion.

With your given expression I will be able to report URL only if it contains "="BMC_COMPUTERSYSTEM)" string & it will not match if there are any other special characters like @ or &.

However I'm able to get desire result by writing below expression with help of dynatrace support,

(param=[0-9]+%2F).+(BMC_COMPUTERSYSTEM).+

To report URL like,

http://xyz.com/abc/efg/?param=266/BMC_COMPUTERSYSTEM

BR,

AK