Event rule to transform a node name.

kranthi
Tera Contributor

Hello ,

 

we have events coming with node is name with FQDN or Short name like adc.ap.com or just adc.

But in CMDB we have CI names with shortname , without fqdn.

In the event rules , we have created a regex to strip the FQDN  and mapped to a variable u_host , it is working as excepted, but the problem is when the event is created with  name  the regex does not return the value.

so the CI biding is not happening, need a solution where regex should ignore or give shortname instead of null.  

kranthi_0-1744103609920.png

 

Thanks,

kranthi.

8 REPLIES 8

Kieran Anson
Kilo Patron

Hi,

ServiceNow host binding will natively search the name without the domain part if your CI data is clean.

 

For example if an event contains computer1.myorg.com, it will use that to search the FQDN column on cmdb_ci_hardware. If no CI is found, it will strip the domain and search the first part "computer1" in the name column.

 

Does your CI data make correct use of the name & FQDN columns?

Hello Kieran,

Thanks for your reply, CMDB has clean CI's. CI's are having both FQDN and Name updated.

But we need only the hostname to passed in the variable of Node in transform maps, as this is being used in the flow to create incidents.

The flow creates a Incident with blank empty CI name.

 

Thanks,

kranthi.

Your flow is triggered off the alert table, so it should be using the configuration item field of the alert. Is this not the case, is it taking the event values?

 

I'm a bit confused on how you're mixing events, event rules, and triggered flows

Hello kirean,

 

This is the error , while binding the Ci at the event processing

 

Custom script 'EvtMgmtCustom_PostBind_Create' called successfully for event
Binding alert CI process flow:
Node is FQDN
Node was not found, checking by name
Event CI type is empty
No CI found for binding (Failed to resolve the event node to CI id)
Binding Failure Reason: Failed to find the host with name

 

Thanks,

kranthi.