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

Myoung Jun Ko·2024년 3월 17일

ElasticSearch로 bulk를 진행할 때, 아래와 같은 에러를 반환 받을 때가 있다.

{
    "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
}

이때는 json 파일 마지막에 개행을 하나 추가하면 된다.

0개의 댓글