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

Regex - Ignore white spaces

gabriel_casella
Dynatrace Pro
Dynatrace Pro

I have this regex:

.*ErrorCode=(?!00;).*Pipeline\$SmilesSBServices\$AccumulateMiles.*

that is used in the "Value" field on a "Argument Value" metric.

The data that it matches is:

<rep:messagecontext xmlns:rep="http://www.site.com/hidden/hidden">   <rep:labels>PartnerTransactionId=SML-01234567890;PartnerId=COD;ErrorCode=92;ErrorMessage=CPF not found;memberCpf=12312312332;transactionDate=2016-12-21T23:12:24.517</rep:labels>   <rep:inbound-endpoint name="Pipeline$SmilesSBServices$AccumulateMiles$AccumulateMilesPipelineV1">     <rep:service>       <rep:operation>AccumulateMilesPartner</rep:operation>     </rep:service>     <rep:transport>       <rep:uri>/uri/path</rep:uri>       <rep:mode>request-response</rep:mode>       <rep:qualityOfService>best-effort</rep:qualityOfService>     </rep:transport>   </rep:inbound-endpoint>   <rep:outbound-endpoint name="Pipeline$SmilesSBServices$AccumulateMiles$AccumulateMilesPipelineV1">

My question is:

Why (in DT) the regex does not work if I don't have the "Ignore Whitespaces" checkbox enabled?
Does "Ignore Whitespaces" also applies to ignoring new lines (line break)?

Details:

This data was copied from the arguments field of the method details in PurePath Dashlet. Would be the case of it being processed to a big string instead of being the original message?

2 REPLIES 2

I've found Dynatraces regex tool to not always respond in the same way as standard regex tools found online.
Does 'Ignore Whitespaces' also apply to ignoring new lings (line break)?

If the string you're evaluation is just one big string it should not matter if 'Ignore Whitespaces' is going to ignore new lines/line breaks. I suppose there could be some hidden characters doing some formatting.

I suppose you could try inputting a similar string without any formatting to test this theory.

Regards,

Tony

Tks, I will try to test it later. Will need a mock application to do this the right way.