Hi,
for event generation you can use PostEvent function. You can put everything into your filter script, but this seems a bit illogical, or create a script action. I would create a rule that matches event and executes script action. Inside that script (either filter script or action script) you can use something like this:
if ($event->parameters[1] ~= "^SNMP_TRAP: Virtual (.*) has become unavailable")
{
PostEvent($node, "CUSTOM_EVENT", null, $1);
}
This will generate new event named CUSTOM_EVENT with path extracted from original event passed as first parameter.
Best regards,
Victor