Ruby Filter Question


I'm experimenting with the ruby filter to execute arbitrary ruby code on events and so far, its been very successful, but I have a couple of questions please.

[1] Is it possible to persist data between events? I appreciate that each log event is processed separately but wondered whether perhaps a variable could be 'global' and persist from event to event?

[2] Is it possible to call other ruby code from within that filter? For example would it be feasible to call an external ruby script and still have access to event['field'] type data?

Would be grateful for any pointers or resources which describe whats possible with this filter.