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

This product reached the end of support date on March 31, 2021.

Find Regexp and Print Regexp in Custom Attributes of DMI Report

Hi


I'm trying to find some documentation or examples of how to use the Find regexp and Print regexp fields of the Custom Attributes part of a DMI report.


For example, I have a DMI that creates a series of charts, one per 'server name'. but the servernames are quite long and the relevant info is towards the end and these are lost as the charts are quite small... I want to just print the relevant part of the name as the chart title, instead of full  name.


Example:


www.mydomain.co.uk DU4 [Site]


I want to be shown just as DU4


 


Thanks

8 REPLIES 8

ulf_thorn222
Inactive

 

Not sure this would fly as my Regexp competence could need some improvment, but try this

www.mydomain.co.uk(.*)

Else you could try with the online tester

 

adam_piotrowicz
Dynatrace Pro
Dynatrace Pro

Gary,

General rule is that in Find regexp field you put a regex with few round brackets in selected places. Then in Print regexp format field you put position numbers of particular round brackets from Find regexp field but surrounded by curly brackets. The order of curly brackets can be changed.

As Ulf says, put:

Find regexp
www.mydomain.co.uk(.*)

and:

Print regexp format
{1}

and you should get "DU4 [Site]".


You can also move the DU4 to the front of SS name by providing:

Find regexp
(www.mydomain.co.uk)(.*)

and

Print regexp format
{2}{1}

Or more complex:

Find regexp
(www/..*/.co/.uk)(.*)

Do you want to get rid/move the "[Site]" part?


Thanks Adam

Two things here;

 

When I try to do this for a table, it doesn't matter what I put in the Find or Print field, the output is always blank.

even using (.*) in find and \{1\} in the print I still get a blank entry. (Added the \ before \{ just so this editor didn't try to think they were something else - didn't actually put the slashes in!)

When I do this for a graph, it always shows the full field contents, again irrespective of what I add, even the same as gives me blanks for a table

 

I am using 11.5 for these - is this a known issue?

Thanks 

 

Only Find field is a typical regex filed. In Print don't use regex syntax, just {1}, {2}, {3}, etc.

To be honest I verified it only for table ... and it may be not intended to work on charts - I will check it and let you know.

11.5? I just don't remember (smile) It was so long ago, but let's start with (.*) for Find and {1} for Print, OK?


Adam

That's exactly what I tried and even those didn't work for table. I suspect another 11.5 issue which won't get fixed (sad)

Don't talk about updating, it's a very political hot potato here at the moment!

 

I'm afraid we won't be able to fix it for 11.5 ...


Thought as much.

Have to live with it for a while then.

ulf_thorn222
Inactive

 

Hmm - I thought 11.5 was unsupported (wink) !