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

How is this script being called?

It is a script include

script to manipulate the Alert object after the related Configuration Item is identified, and before the Alert is created in the database. This script can also be used to abort Alert creation. 

Generally, what's been done is strongly discouraged because of the performance impact as-well as the impact of data loss. If your script/BR isn't handling it, your events cause be marked as processed with no alert, because your custom logic is aborting the creation. 

 

I can't really help with a custom script without seeing it. But I'd question at why it was needed when you should be able to manage the assignment of a node via the event rule. 

Jeffreys Quinti
Tera Contributor

Hi,

 

Try ([^.]*).* 

 

 

if you have set CI field matching in the binding you should rename your expression "name"

 

hope it helps