Access to 'Addtional Info' fields in EvtMgmtCustom_PostBind_Create & _Update

stevemacamway
Giga Expert

I'm trying to set the short_description field in an Alert to be a value from the [Event > Additional Info] field. By default short_description gets set to "[Event > Type] - [Event > Node] - [Alert > Description]" 

Doing so directly in the Event Rule Transform is not working. The short_description field is not available in the 'Compose Alert' field list, so I am using the 'Manual attributes' section. Unfortunately, while this puts the new 'short_description' into the Alert > Additional Information field, it does not set the Alert > Short Description. 

To resolve this, I am hoping to use the EvtMgmtCustom_PostBind_Create & EvtMgmtCustom_PostBind_Update Script Includes. (If there is a better way to do this, please let me know.)

My question is this: are the Additional Info fields easily available in these Script Includes as dot-walkable fields? Or am I going to have to parse the data out of the additional_info field using regex? I'm on Jakarta, so the EvtMgmtCustom_PostTransformHandler is not available.

1 ACCEPTED SOLUTION

Alexander Mitov
Giga Guru

additional_info contains JSON. What I typically do is something like:

 

var obj = JSON.parse(event.additional_info);

 

Then you can access the parameters and values from there:

obj.short_description - this will hold the value from the "short_description" parameter in "additional_info".

 

 

I hope this helps 🙂

View solution in original post

2 REPLIES 2

Alexander Mitov
Giga Guru

additional_info contains JSON. What I typically do is something like:

 

var obj = JSON.parse(event.additional_info);

 

Then you can access the parameters and values from there:

obj.short_description - this will hold the value from the "short_description" parameter in "additional_info".

 

 

I hope this helps 🙂

Geez do I feel like a fool for not remembering it is JSON...

 

Thank you Alexander!