Binding Event Rules to dynamic CI names

Henrik Jutterst
Tera Guru

I'm trying to create an Event Rule where I should bind to the related Database CI.

The problem is that these CIs have a dynamic name, built up by:
<database>@<instance>@<host>, example myProdDatabase@myInstance01@myHost01 .

I have all the data in the event:
* myProdDatabase
* myInstance01
* myHost01

But when I create my Event Rule and try to bind to the database and name identifier, I was having issue to find the CI, because ServiceNow was not able to use variables in order to have dynamic names in the CI: <database>@<instance>@<host>

Question:
Therefore, is there a way around this when we are using dynamic names on the database CIs?
Or what is the alternatives here? Bind it direct to the Host is not the same really, but yeah..

 

 

HenrikJutterst_0-1698678928970.png

 

 

 

 

Look in the Processing notes on the event:
--------------------------------
Processing notes says:
Binding alert CI process flow:
Binding identification engine error: the input field(s) "name", "instance_name", that the rule "DynamicCIName" specified are empty and therefore no value was found to create the binding.
Run Identification Engine. No matching CI was found. But host was found by Identification Engine.
Identification Engine Errors:
Too many other errors.
In payload missing minimum set of input values for criterion (matching) attributes from identify rule for table [cmdb_ci_db_mssql_instance]. Add these input values in payload item '{"className":"cmdb_ci_db_mssql_instance","values":{"instance_name":null,"sys_class_name":"cmdb_ci_db_mssql_instance"},"internal_id":"1f674522bc46b510023e5205bcfefb2f","sys_object_source_info":{},"settings":{},"sys_ire_info":{},"display_values":{}}'.
Event CI type is empty
No related CI found for binding, alert CI will be bound to node (id): 8eff2432db1fbbc01918d29c6896197f
Bind to 8eff2432db1fbbc01918d29c6896197f

Event rule applied: DynamicCIName
--------------------------------

1 ACCEPTED SOLUTION

Hi Henrik,

 

 I can appreciate wanting to blur out sensitive information - however it would be easier if I had the xml event record to test 🙂 

 

That said, as you know, when using a non-host binding method, you'll remove the Node, give it a class/table to search and then the rule takes into consideration ALL of the variables within Addtional_Info to find a match.

 

If we're trying to match on an attribute that you don't want to use, we can negate the value (remove it from the search criteria) by adding another manual attribute using the variable name only then leave the value blank - it should look something like this ::

 

Screenshot 2023-12-08 at 10.16.04 AM.png

 Let me know if this works for you

View solution in original post

11 REPLIES 11

Hi and thanks for feedback Ryan!

 

I got the dynamic Name using CI Field Matching. Thanks!


I tried CI Field Matching, but binding does not work since the Query points to the actual "host name" and not the sys_id of the host name.

 

How is that done then?

 

 

In the eveevent, in processing notes, it's looking for this :

 

//query in CI Field Map
"database=<dbName>^host=<hostName>^name=<dynamicName>^install_status!=7^ORinstall_status=NULL";

//What I need to query in CI Field Map
"database=<dbName>^host=<hostName_sys_id>^name=<dynamicName>^install_status!=7^ORinstall_status=NULL";

 

 

The host gets found on fqdn from node, but is there a way to save that sys_id and use it to get the query to work?

 

 

HenrikJutterst_0-1702044620657.png

 

Hi Henrik,

 

On the event rule I created a manual entry to build the Name, along with using the CI Field Matching binding strategy ::

 

Screenshot 2023-12-08 at 9.05.16 AM.png

 also don't forget to remove the contents of Node 

Screenshot 2023-12-08 at 9.06.08 AM.png

 

Here is the Database entry ::

 

Screenshot 2023-12-08 at 9.04.24 AM.png

and Alert successfully bound to the MS SQL Database ::

 

Screenshot 2023-12-08 at 9.03.56 AM.png

let me know if this is what you were trying to achieve or if I misunderstood.

 

Thanks,

-Ryan

 

That's exactly what I'm looking for, but in my case, the binding is looking for a host name also in the processing notes on the query.

 

I have the host name, but only in text. not as a sys_id.

 

Wonder if I need to try it out in a PDI 😕

This is what I get in processing notes on the event:

HenrikJutterst_0-1702047464733.png

 

Hi Henrik,

 

 I can appreciate wanting to blur out sensitive information - however it would be easier if I had the xml event record to test 🙂 

 

That said, as you know, when using a non-host binding method, you'll remove the Node, give it a class/table to search and then the rule takes into consideration ALL of the variables within Addtional_Info to find a match.

 

If we're trying to match on an attribute that you don't want to use, we can negate the value (remove it from the search criteria) by adding another manual attribute using the variable name only then leave the value blank - it should look something like this ::

 

Screenshot 2023-12-08 at 10.16.04 AM.png

 Let me know if this works for you

Thank you!!

That was the missing piece!!

Clearing out the host name!