Hi,
I`m trying to setup a Measure which is using the metric - Methods - Argument Value.
I`m splitting a business transaction using the measure but would like to group the results based upon regexes of the String argument -
eg -
If the argument was 'Test 1', 'Test 2', or 'Test 3' - these would be grouped and counted together - if the argument was 'Foo 1', 'Foo 2' or 'Foo3', these would be grouped together.
My regex is - (Test).*|(Foo).*|(.*)
But when using this and testing it, the result includes the non matched capture groups, but as 'null' -
Is there anyway to eliminate the 'nulls' from the results?
Thanks, Mike
Answer by Andreas G. ·
Hi. It seems that Sean McConville uploaded some screenshots to this page but didnt actually post a comment. This seems to be his solution:
Answer by Sean M. ·
Hi Andreas/Mike,
I didn't post them because I realised the grouping wasnt quite the same....in fact I was only creating one group, rather than 3.
I've looked further at this now and I wonder if internally dynatrace is using .matches() rather than .exec() and that is why we are seeing null returned for empty groups. It might be the case that some code needs to go into dynaTrace to check for null and replace with an empty string? Although I think .exec() might do this anyway?
Can you think of any other way around this?
Many thanks,
Seán.
Answer by Sean M. ·
Hi Richard,
No apology required, in-fact, I think you have jogged my brain to think about it differently.
I shouldn't be trying to create splitting groups like this using regex to match a pattern.
Instead I should negate the UID position in log message with the transformation regex so that particular log messages become equal, and you are right, this can all be done in a single group.
So I would use something like
(.*foo[^.*]|.*bar[^.*])
To achieve what I am looking to.
Please close my RFE if you have the access.
Many thanks,
Sean
JANUARY 15, 3:00 PM GMT / 10:00 AM ET