Elastic Search( Store XML data as just a string)

Hi Team,
I am using kibana and ES versions 8.14.

I am sending a json through Java Bulk call API
{"uuid": string type
instance: string type
inputJson : JsonNode type
xmlmxmessage: xmlbutinStringformat
}

this is the mapping for xmlmxmessage.


"xmlmxmessage":{
"type":"text",
fields:{
"keyword:{
"type":"keyword",
"ignore_above":256
}
}

but when I create a Kibana data view of this and add a new field with link to open link on a new tab, shows the complete xml but removes all the tags and becomes a big string.

But when I few the xmlmxmessage as field and check the value it has the xml.

I also have a doubt if my xmlmxmessage is saved as text, is it analysed or indexable? I don't want it to indexed.

You can mark the text field as not indexed (see index | Elasticsearch Guide [8.14] | Elastic). Also remove the keyword sub field. It's not needed.

How can I remove the field keyword subfield?
Also what is the best way to store xml data(without being indexed) and to be used just to view data.

You need to provide the right mapping when you create the index.