below is the script field
GET log-2022.03.30/_search
{
"script_fields": {
"message": {
"script": {
"lang" : "painless",
"source": "doc['message.keyword'].value"
}
}
}
}
and here is the result I got
"failures" : [
{
"shard" : 0,
"index" : "log-2022.03.30",
"node" : "Jei35aKrR0-jxyKKld12jss",
"reason" : {
"type" : "script_exception",
"reason" : "runtime error",
"script_stack" : [
"org.elasticsearch.index.fielddata.ScriptDocValues$Strings.get(ScriptDocValues.java:494)",
"org.elasticsearch.index.fielddata.ScriptDocValues$Strings.getValue(ScriptDocValues.java:508)",
"doc['message.keyword'].value",
" ^---- HERE"
],
"script" : "doc['message.keyword'].value",
"lang" : "painless",
"position" : {
"offset" : 22,
"start" : 0,
"end" : 28
},
"caused_by" : {
"type" : "illegal_state_exception",
"reason" : "A document doesn't have a value for a field! Use doc[<field>].size()==0 to check if a document is missing a field!"
}
}
}
]
Kindly help on this.