Error when installing template "request body is required"


(Sylvain 69) #1

Hello,

Here is the error I get when I try to install Winlogbeat template into Elasticsearch :

curl -XPUT -H 'Content-Type: application/json' http://localhost:9200/_template/winlogbeat-6.1.0 -d@winlogbeat.template-6.1.0.json
Warning: Couldn't read data from file "winlogbeat.template-6.1.0.json", this
Warning: makes an empty POST.
{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400}

Can you help me please ?


(Sylvain 69) #2

One more information, I exported the template from the powershell command

PS> .\winlogbeat.exe export template --es.version 6.1.0 | Out-File -Encoding UTF8 winlogbeat.template-6.1.0.json


(David Pilato) #3

That's a curl / windows issue.
Not related to elasticsearch.

Use the Kibana dev console. Much easier.

Or check curl help for windows.
Or check that your file actually exists and is readable and it's content.


(Sylvain 69) #4

Hello dadoonet,

Actualy my ELK stack is installed on Centos 7 and I use the command curl on it.

But I will defenitly start using the kibana dev console !
Thank You.

I just started using ELK, I'm not use to it yet !


(Sylvain 69) #5

And also, I wasn't in the right directory when executing the curl command, so the file was not here...

So sorry about that !

Thank you.


(system) #6

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