Thanks Badger,
I have tried removing the _all
field and reapplying the template via the API Console:
{
"template": "logstash-qa01-stats-*",
"settings": {
"index.refresh_interval": "10s"
},
"mappings": {
"_default_": {
"dynamic_templates": [{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": true,
"doc_values": true
}
}
}, {
"byte_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"short_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"integer_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"long_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"float_fields": {
"match": "*",
"match_mapping_type": "double",
"mapping": {
"type": "double",
"doc_values": true
}
}
}],
"properties": {
"@timestamp": {
"type": "date",
"format": "date_optional_time"
},
"@version": {
"type": "keyword",
"index": true
},
"type_instance": {
"type": "text",
"index": true,
"norms": false,
"fields": {
"raw": {
"type": "text",
"index": true
}
}
}
}
}
}
}
But I am getting the following error:
{
"status": 400,
"error": {
"caused_by": {
"reason": "Root mapping definition has unsupported parameters: [_default_ : {dynamic_templates=[{string_fields={mapping={index=true, type=string, doc_values=true}, match_mapping_type=string, match=*}}, {byte_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {short_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {integer_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {long_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {float_fields={mapping={type=double, doc_values=true}, match_mapping_type=double, match=*}}], properties={@timestamp={format=date_optional_time, type=date}, type_instance={norms=false, index=true, type=text, fields={raw={index=true, type=text}}}, @version={index=true, type=keyword}}}]",
"type": "mapper_parsing_exception"
},
"root_cause": [
{
"reason": "Root mapping definition has unsupported parameters: [_default_ : {dynamic_templates=[{string_fields={mapping={index=true, type=string, doc_values=true}, match_mapping_type=string, match=*}}, {byte_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {short_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {integer_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {long_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {float_fields={mapping={type=double, doc_values=true}, match_mapping_type=double, match=*}}], properties={@timestamp={format=date_optional_time, type=date}, type_instance={norms=false, index=true, type=text, fields={raw={index=true, type=text}}}, @version={index=true, type=keyword}}}]",
"type": "mapper_parsing_exception"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [_default_ : {dynamic_templates=[{string_fields={mapping={index=true, type=string, doc_values=true}, match_mapping_type=string, match=*}}, {byte_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {short_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {integer_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {long_fields={mapping={type=double, doc_values=true}, match_mapping_type=long, match=*}}, {float_fields={mapping={type=double, doc_values=true}, match_mapping_type=double, match=*}}], properties={@timestamp={format=date_optional_time, type=date}, type_instance={norms=false, index=true, type=text, fields={raw={index=true, type=text}}}, @version={index=true, type=keyword}}}]"
}
}
If I change my template to:
{
"template": "logstash-qa01-stats-*",
"settings": {
"index.refresh_interval": "10s"
},
"mappings": {
"dynamic_templates": [{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": true,
"doc_values": true
}
}
}, {
"byte_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"short_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"integer_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"long_fields": {
"match": "*",
"match_mapping_type": "long",
"mapping": {
"type": "double",
"doc_values": true
}
}
}, {
"float_fields": {
"match": "*",
"match_mapping_type": "double",
"mapping": {
"type": "double",
"doc_values": true
}
}
}],
"properties": {
"@timestamp": {
"type": "date",
"format": "date_optional_time"
},
"@version": {
"type": "keyword",
"index": true
},
"type_instance": {
"type": "text",
"index": true,
"norms": false,
"fields": {
"raw": {
"type": "text",
"index": true
}
}
}
}
}
}
Elastic accepts it, but then my logstash starts complaining with the following:
[2020-04-15T18:03:42,481][ERROR][logstash.outputs.elasticsearch] Attempted to send a bulk request to elasticsearch' but Elasticsearch appears to be unreachable or down! {:error_message=>"Elasticsearch Unreachable: [https://logstash-qa01:xxxxxx@ea33a63cd7ed235230b7aedcd62e4c37.eu-west-1.aws.found.io:9243/][Manticore::SocketTimeout] Read timed out", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError", :will_retry_in_seconds=>64}
[2020-04-15T18:03:43,789][WARN ][logstash.outputs.elasticsearch] Marking url as dead. Last error: [LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError] Elasticsearch Unreachable: [https://logstash-qa01:xxxxxx@ea33a63cd7ed235230b7aedcd62e4c37.eu-west-1.aws.found.io:9243/][Manticore::SocketTimeout] Read timed out {:url=>https://logstash-qa01:xxxxxx@ea33a63cd7ed235230b7aedcd62e4c37.eu-west-1.aws.found.io:9243/, :error_message=>"Elasticsearch Unreachable: [https://logstash-qa01:xxxxxx@ea33a63cd7ed235230b7aedcd62e4c37.eu-west-1.aws.found.io:9243/][Manticore::SocketTimeout] Read timed out", :error_class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError"}
Any ideas what might be happening here?