How to get the IP address from a variable through an Event Procedure and Regular Expression?
DX NetOps Spectrum all current Releases
Component : Spectrum Alarm & Event Management
Use the following Site to validate your REGEX:
((?:\d+\.){3}\d+)
The following is an example:
The Event Procedure on 0x210d40
event code will generate the 0xfff0000e
event code with the existing variable and it will grab the IP Address from the variable {S 4}
and put it in the variable {S 6}
.
0x210d40 E 0 P "CreateEventWithVariables({C CURRENT_MODEL}, {H 0xfff0000e}, \
SetEventVariable( \
GetEventVariableList(), \
{U 6}, \ GetRegexp(GetEventVariable({U 4}), \
{S \"((?:\\\\d+\\\\.){3}\\\\d+)\"}, \
{U 1}) \
) \
)"
0xfff0000e E 0
The following section of our online Spectrum TechDocs guide details using Escape Characters in Event Procedures:
TechDocs : DX NetOps Spectrum 22.2 : About Event Disposition Files