PhilODonnell
Technical User
To all TEC rule writing gurus, I need your help.
I have a requirement to write a rule which performs the following:
IF an event is received with the CLASS of ‘IOM_B_Failed’ and an event of ‘IOM_BS_Failed’ is already in the cache
WHERE a certain piece of information within the slot objectname are the same then drop the incoming event.
Within the objectname slot there is some text I need to extract and use this as the test eg. objectname=sometext1,host=x.y.z,port=999
I want the value assigned to host, in this instance x.y.z
I could setup
re_create(_searchobjectname, ‘(.*host=)(\S+)\,(.*)’)
within a ‘TEC_Start’
then I could use something like
re_match(_searchobjectname,_objectname,2, _result)
where _result would hopefully equal x.y.z.
Now the problem I have is how can I use this information within the create_event_sequence predicate as I cannot use the _result information as its not a slot. My understanding of this predicate is that you can only compare slot values.
If I cannot use create_event_sequence does anyone else have any ideas how I can compare the information within the objectname slot for 2 TEC CLASSES that would achieve my initial description?
Any help would be appreciated.
Cheers
Phil O’Donnell
I have a requirement to write a rule which performs the following:
IF an event is received with the CLASS of ‘IOM_B_Failed’ and an event of ‘IOM_BS_Failed’ is already in the cache
WHERE a certain piece of information within the slot objectname are the same then drop the incoming event.
Within the objectname slot there is some text I need to extract and use this as the test eg. objectname=sometext1,host=x.y.z,port=999
I want the value assigned to host, in this instance x.y.z
I could setup
re_create(_searchobjectname, ‘(.*host=)(\S+)\,(.*)’)
within a ‘TEC_Start’
then I could use something like
re_match(_searchobjectname,_objectname,2, _result)
where _result would hopefully equal x.y.z.
Now the problem I have is how can I use this information within the create_event_sequence predicate as I cannot use the _result information as its not a slot. My understanding of this predicate is that you can only compare slot values.
If I cannot use create_event_sequence does anyone else have any ideas how I can compare the information within the objectname slot for 2 TEC CLASSES that would achieve my initial description?
Any help would be appreciated.
Cheers
Phil O’Donnell