Using a SPECTRUM Event Procedure to extract an ip address substring from a varbind to populate a new varbind

book

Article ID: 51979

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

Using a SPECTRUM Event Procedure to extract an ip address substring from a varbind to populate a new varbind

Environment

Release: Any
Component:

Resolution

This can be done using an Event Procedure.

In the following Event Procedure, using the above requirement as an example, for the current model event 0xabcd0000 is associated with, the Event Procedure will take the input varbind 4 (U 4), apply a regular expression looking for the characters between the dots(.) (as in an ip address) and save the result to a new varbind 20 (U 20) and pass all the varbind variables including the new varbind 20 to new event 0xabcd0001.


 

0xabcd0000 E 50 P " \
 CreateEventWithAttributes( \
   { C CURRENT_MODEL }, \
   { H 0xabcd0001 }, \
   SetEventAttribute( \
     GetEventAttributeList(), \
     { U 20 }, \
     GetRegexp( GetEventAttribute( { U 4 } ), \
                { S \".*?:.*?:(.*)\" }, \
                { U 1 } ) \
     ) \
 )"