Hello, I'm working with data tables in kibana and would like to create an additional column from a script. The following script is working
{ "script" :
"if (doc['cpu.used.pct'].value > 100) { return 1 }"
}
But I would like to create a new field of type string. The following script is not working and returns:
class_cast_exception: class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')
{ "script" :
"if (doc['cpu.used.pct'].value > 100) { return \"CRITICAL\" }"
}
Is there a way to achieve the result?
Thanks