Hi,
i have problem with mappings after upgrade 5.6 to 6.8. Actually priority is how i can set new template for 6.8 version with multiple types
Error
"reason"=>"Rejecting mapping update to [logstash-2020.02.04] as the final mapping would have more than 1 type: [_doc, logfiles]"}}}}
Template
"logstash" : {
"order" : 0,
"index_patterns" : [
"logstash-*"
],
"settings" : {
"index" : {
"number_of_shards" : "5",
"number_of_replicas" : "1",
"refresh_interval" : "5s"
}
},
"mappings" : {
"_doc" : {
"dynamic_templates" : [
{
"message_field" : {
"mapping" : {
"norms" : false,
"index" : "true",
"type" : "keyword"
},
"match_mapping_type" : "string",
"match" : "message"
}
},
{
"string_fields" : {
"mapping" : {
"norms" : false,
"index" : "true",
"type" : "text",
"fields" : {
"raw" : {
"ignore_above" : 256,
"index" : "true",
"type" : "keyword"
}
}
},
"match_mapping_type" : "string",
"match" : "*"
}
}
],
"properties" : {
"server" : {
"index" : "true",
"type" : "keyword"
},
"environment" : {
"index" : "true",
"type" : "keyword"
},
"component" : {
"index" : "true",
"type" : "keyword"
},
"system" : {
"index" : "true",
"type" : "keyword"
},
"geoip" : {
"dynamic" : true,
"type" : "object",
"properties" : {
"location" : {
"type" : "geo_point"
}
}
},
"processed_by" : {
"index" : "true",
"type" : "keyword"
},
"@version" : {
"index" : "true",
"type" : "keyword"
},
"type" : {
"properties" : {
"index" : {
"norms" : false,
"type" : "text",
"fields" : {
"raw" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
}
}
}
}
}
},
"aliases" : { }
}
}
is this possible? I try add properties to "types"
"type": {
"properties": {
"logfiles": {
"index": true,
"type": "keyword"
}
But probably this is wrong way :(, Also when i set type "_doc" to "logfiles" is works for this index like logstash-{date} but what when i have something like that logstash-{number}-{date}.
Message form logstash (JSON)
{
"_index": "logstash-2020.02.04",
"_type": "appname",
"_id": "Wv9OEHABJQBVNSJTx_z8",
"_version": 1,
"_score": null,
"_source": {
"app": "appname",
"server": "serwer.com",
"clientid": "KlientID",
"identify": "logstash-2020.02.04",
"contact_info": "person",
"message": "text message",
"type": "logfiles",
"redis_host": "server.com",
"path": "/var/log/test.log",
"environment": "prod",
"@timestamp": "2020-02-04T13:06:03.064Z",
"system": "TEST",
"processed_by": "server.com",
"loglevel": "ERROR",
"@version": "1",
"host": "server",
"timestamp": "2020-02-04T14:06:03.064+0100"
},
"fields": {
"@timestamp": [
"2020-02-04T13:06:03.064Z"
]
},
"sort": [
1580821563064
]
}