Import index template


(Guido Van Brakel) #1

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.


(Pier-Hugues Pellerin) #2

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.


(Guido Van Brakel) #3

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
}


(Pier-Hugues Pellerin) #4

@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.


(Guido Van Brakel) #5

Nope just the default one on github


(system) #6

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