Keeping global variables in LS?!

You have to do it like this:

      if ([@metadata][LOCAL_FIELD_4] =~ /.+/) {
            ruby{
                code => "
                         event['type'] = 'costing'
                         event['tslice'] = @@TimeStamp
                         event['senderID'] = @@SenderId