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.
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.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.