I am trying to use the elasticsearch bulk api to insert multiple records into an index. My JSON looks something like this: request json
I am inserting a new line (\\n
) at the end of the document but I'm still getting the newline error
.
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
}
Based on my previous answer and https://stackoverflow.com/a/50754789/8160318: