Import index template

Hi,

I'm trying to import the filebeat index template on CentOS 7, but I'm getting this error:

curl -XPUT 'http://localhost:9200/_template/filebeat?pretty' -d@filebeat-index-template.json
{
"error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
"status" : 406
}

I'm trying to setup kibana, logstash, elasticsearch and filebeat all on one server.Please help.

Hello @Guido_van_Brakel, Elasticsearch 6.0 is more strict on the received content-type and will refuse anything not application/json.

Adding -H'Content-Type: application/json' to your CURL command should do the trick.

Thanks for your reply, but then I'm getting this error:
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "No handler for type [string] declared on field [message]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [default]: No handler for type [string] declared on field [message]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "No handler for type [string] declared on field [message]"
}
},
"status" : 400
}

@Guido_van_Brakel let's take a step back, did you make any modifications to the template? Because Filebeat by default on startup will upload the template.

Nope just the default one on github

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.