Hello,
I'm using ELK to centralize events.
I customized my Elasticsearch template to have not_analyzed fields by default, and some specific analyzed fields, but now I see that I am blocked to create some vizualisations because these fields have no .raw field.
I want to keep my actual template but also have .raw not_analyzed fields for all my analyzed ones. How can I do that?
My template looks like this
{
"template" : "events-*",
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true},
"dynamic_templates" : [ {
"not_analyzed_string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "string", "index" : "not_analyzed", "omit_norms" : true, "doc_values" : true
}
}
} ],
"properties" : {
"@version": { "type": "string", "index": "not_analyzed" },
"action" : {
"type" : "string",
"index" : "analyzed"
},
"message" : {
"type" : "string",
"index" : "analyzed"
},
"path" : {
"type" : "string",
"index" : "analyzed"
}
}
}
}
}
I imagine there can be 2 answers:
- add the .raw field for each of the specifically analyzed fields
- tell ES to automatically add this .raw field for each analyzed field
I would prefer solution 2 but I have no idea how to do it. Neither for solution 1.
Thanks for your help