17 Sep 2025 07:57 PM - edited 18 Sep 2025 01:49 PM
I am working on an Auto Tag rule for custom devices using a regular expression statement which for the most part is successful. I am seeing though where the tag key gets duplicated, with either no value, or a value which was to be excluded from the result.
Example #1 -
{CustomDevice:Name/^([A-Za-z][A-Za-z][A-Za-z])}
Using CMHLEAF123.test.com as the entity name, the results are -
The rule correctly captures the three letter code used for the tag key, as seen in the "Site Code:CMH" tag, however I'm not exactly sure how the tag, "Site Code", with no value assigned, is applied. I have no rule which suggests this.
Example #2 -
{CustomDevice:Name/(?:Cisco network device) ([A-Za-z][A-Za-z][A-Za-z])}
Using Cisco network device CMHLEAF123.test.com as the entity name, the results are -
In this example, the rule correctly captures the three letter code used for the tag value, as seen in the "Site Code:CMH" tag, however I'm not exactly sure how the tag, "Site Code:CIS" is created especially since I've specifically excluded the additional text in the regular expression statement.
The first example occurs not just for the Site Code tag, but for other tags as well, as seen with the "Host group" tag.
I am looking for suggestions from the community on this.
21 Aug 2026 02:43 PM
Hey Bill, Sorry this is a late reply, but Dynatrace Regex can be finicky, You could call out the design of the naming convention and then parse out the segment that you want. I use Regex101 to test things out as well as trial it all out in Dynatrace.
Try this: ([A-Z]{3})[A-Z0-9]{7}\.
Assuming that your host names will always be 10 Characters.
Featured Posts