24 Sep 2025 09:02 PM
I've been working on updating our automatic tag rules for a current project and would like to use Regex to capture a device type from a dns name, i.e. ABCCORE01.TEST.COM. The ABC prefix is the location of the device, and CORE is the device type. I would like to only use the device type as an optional tag value, such as "Device Capability: <value>". I'm sure this is nothing new.
This worked in regex101, but not in DT...
^[a-zA-Z0-9]{0,3}([a-zA-Z]+?)\d
The location prefix can be ABC or AB1.
25 Sep 2025 06:59 AM
you can try this one, {Host:DetectedName/^AB[C0-9]([^.]*+).*$/$1/}
25 Sep 2025 09:00 AM
Please check https://docs.dynatrace.com/docs/shortlink/regex
From my experience: pick the ungreedy option to test in regex101
with ^[A-Za-z0-9]{3}([A-Za-z]+?)\d+\.