We are getting Ruby exception error in logstash

The event.get is returning nil, meaning the field does not exist. You can either save the result of event.get in a local variable and use a conditional before using it, or wrap the .get/.set in begin/rescue/end.