SELECT "message" FROM ".kibana-event-log-7.9.1-000001"
message
-----------------
eventLog starting
eventLog starting
When I do a length
POST /_sql?format=txt
{
"query": """
SELECT LENGTH("message") FROM ".kibana-event-log-7.9.1-000001"
"""
}
The error shown is
"reason" : "Found 1 problem\nline 2:10: [LENGTH(\"message\")] cannot operate on field of data type [text]:
No keyword/multi-field defined exact matches for [message]; define one or use MATCH/QUERY instead"
if I put as message.keyword, it fails completely by saying there is no such field present.
There is a mapping template behind
Check it here GET _template/.kibana-event-log-7.9.1-template
You will see this part, wish show that there is no keyword field
"message" : {
"norms" : false,
"type" : "text"
},
If there is no explicit mapping defined, Yes elasticsearch will automtically create 2 fields message as text and message.keyword as keyword
This an explicit mapping that was defined, so no keyword will added by default
You should change the template .kibana-event-log-7.9.1-template
and also change the mapping of already created indexes like .kibana-event-log-7.9.1-000001
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.