CHecking for existance of a field in Ruby filter?

Hi, with the new Ruby event.Set/Get syntax, is there a way to check for the variable being defined?

Trying to event.get for a field that does not exist (say, coming from an optional field in grok) makes a Ruby exception.

ruby {
	code => "
		if event.get('foo')
			# field 'foo' is existed
		else	
			# field 'foo' is missing
		end	
	"
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.