From your description it seems that it's enough to create multiple rules for same event, but with different sources. No script is required in that case. And even if you need more complex filtering, you can implement it as filtering script for the rule.
Best regards,
Victor
Best regards,
Victor
Run nxdbmgr with -X option and the run manually the following queries: