How to take a bulk input from json file where each object is terminated by newline.
I tried ->
curl -XPOST http://localhost:9200/az/doc/_bulk -H "Content-Type: application/json" -d @test.json
my test.json looks like - {
"name":"John",
"age":30,
"cars":[ "Ford", "BMW", "Fiat" ]
}
{
"name":"John1",
"age":33,
"cars":[ "Ford", "BMW", "Fiat" ]
}
az is index.
it's giving error -> {"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}
What should be the correct way to do this?
Please help!