Automations
All questions related to Workflow Automation, AutomationEngine, and EdgeConnect, as well as integrations with various tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to combine two databaseHostNames conditions into one automated tagging rule

cmontesdeoca
Visitor

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")

 

1 REPLY 1

Mohamed_Hamdy
DynaMight Leader
DynaMight Leader

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