I can't upload the sample accounts.json file

Hello I'm new in Elastic.

I'm using Elastic from a Mac. I want to upload de account.json file to elasticsearch with the following command as the documentation says.

_curl -H "Content-Type: application/json" -XPOST 'localhost:9200/bank/account/bulk?pretty&refresh' --data-binary "@accounts.json"

But I get the following message

Warning: Couldn't read data from file "accounts.json", this makes an empty
Warning: POST.
{
"error" : {
"root_cause" : [
{
"type" : "parse_exception",
"reason" : "request body is required"
}
],
"type" : "parse_exception",
"reason" : "request body is required"
},
"status" : 400
}

What I'm doing wrong?

1 Like

This warning is coming from the curl command - it cannot read the "accounts.json" file.
That probably means that are running curl from a different directory to the one that has the file.

1 Like

Hello Tim!

Thanks for your reply! Exactly that was the problem.

Thanks so much!

Regards!!

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