16 Jul 2026
03:45 PM
- last edited on
17 Jul 2026
08:02 AM
by
MaciejNeumann
Hi Community, I need to apply an automated tag to some databaseHostNames, but I can only do this with two separate rules, even though both host names start the same way. Is there a way to apply this tag using only one rule? I tried using AND or CONTAINS, but I couldn't find a way to make it work.
Example:
Apply 'TAG' to Entities matching type("SERVICE"),databaseHostNames("DatabaseHostNames")
Apply 'TAG' to Entities matching type("SERVICE"),databaseHostNames("DatabaseHostNames.2")
Solved! Go to Solution.
28 Jul 2026 04:35 AM - edited 28 Jul 2026 04:35 AM
Hi,
You can use a Monitored entity rule, apply it to Services, and add a condition for Database host name.
If the database hostnames share a common prefix, select the Begins with operator and enter the prefix value. Alternatively, select Contains regex and enter the required regular expression when the hostnames follow a more complex naming pattern.
For example, this approach can be used to match database hostnames such as, DatabaseHostNames, DatabaseHostNames.2, DatabaseHostNames.3
Alternatively, when you have only two or three specific database hostnames and prefer to use an entity-selector rule, you can include all the exact values in a single condition:
type("SERVICE"),databaseHostNames("DatabaseHostNames","DatabaseHostNames.2","DatabaseHostNames.3")
This matches a service when its database hostname equals any of the listed values.
Please note that `databaseHostNames()` uses exact matching and does not support modifiers such as `.startsWith()` or regular expressions.
Featured Posts