Unable to load the dataset from json

Hi,

Just I have started tutorial on elasticstic search, while loading the data from json i am getting following exception:
My request is:
curl -H "Content-Type: application/json" -XPOST "http://localhost:9200/bank/_doc/_bulk?pretty&refresh" --data-binary "@accounts.json"

Error is:
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "The bulk request must be terminated by a newline [\n]"
}
],
"type" : "illegal_argument_exception",
"reason" : "The bulk request must be terminated by a newline [\n]"
},
"status" : 400
}

You can find accounts.json here: here
My elastic version is: 6.2.3
Can anyone assist me

Thanks,
Aravind

Probably you are missing a new line after the last element ?

Yes David,

You are correct, after entering new line it got resolved.

Thank you so much

Out of curiosity why did not you find that by yourself based on the error message you got:

The bulk request must be terminated by a newline [\n]

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