Elastic Search Error – The bulk request must be terminated by a newline

By | July 10, 2019
curl -H "Content-Type: application/x-ndjson" -XPOST 'localhost:9200/customers/personal/_bulk?pretty&refresh' --data-binary @"customers_full.json"

[ec2-user@ip-172-31-21-125 ~]$ curl -H "Content-Type: application/x-ndjson" -XPO         ST 'localhost:9200/customers/personal/_bulk?pretty&refresh' --data-binary @"customers_full.json"
{
  "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
}

FIX – Add a New line in customers_full.json

Leave a Reply