I'm trying to generate a scripted field to be the string length of an event field. I've tried more variants of...
if (doc.containsKey('msg')) {
def msg_length = doc['msg'].value.size(); * or value.length()
return msg_length;
} else {
return -1;
}
...that I can even count and am having difficulty understanding why what appears so simple doesn't work. I know I must be missing something fundamental about the language or data typing so any nudge or outright shove in the right direction is MUCH appreciated.
Note... any text field example will work, it doesn't have to be the "msg" object.
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.