I discovered that the default template in 6.4.2 is currently setting the "doc" document_type via mapping.
The result of
GET /customer-environment-2018.11.16/_mapping
is
{
"customer-environment-2018.11.16": {
"mappings": {
"doc": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"auth": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
....
}
Originally, I needed to update the number of shards created by default. The answer to changing the number of shards used on index creation from the default of 5 is to use dynamic templates. https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html In order to create my dynamic template, I needed to copy the existing default mapping created by elasticsearch, then create my template from that with the shards adjusted to my need. Which I have setup and is working just fine.
However, concern comes up when digging further into the mappings type. Since, copying the default template to create the needed amount of shards, I am now explicitly mapping a document type of "doc". According to documentation cited in other questions in the forum, and all the research I can find related to mappings, is that mappings is being completely phased out by version 7.x/8.x.
My questions are:
-Do I wait until those versions release, have elasticsearch create a default index, pull that new template/mapping, then update my existing template to match?
-I've seen multiple solutions that don't seem to work with my situation. I am dynamically creating the index name from filebeat custom fields, then appending the date. It appears anything other than the "doc" document type also breaks the results that I get. I think this is where the issue arises, and where my understanding is lacking. When creating a template without mapping the document type to "doc", all of the fields are missing from the logs. I essentially end up with a datetime. What is the proper way to adjust the number of shards without breaking things from the default template? Is there something else tied to "doc" somewhere that I can update to completely remove that mapping?
I'd like to get ahead of this change so that it's not something I'm fighting when it's time to update. And, hopefully have a better understanding of what I have here, and the pieces of it that I'm not completely familiar with.