# "parse\_exception",

**URL:** <https://discuss.elastic.co/t/parse-exception/119734>\
**Category:** Elasticsearch\
**Created:** [February 14, 2018, 6:38am UTC](https://discuss.elastic.co/t/parse-exception/119734 "2018-02-14T06:38:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anilg](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Anilg](https://discuss.elastic.co/u/Anilg)\
**Post date:** [February 14, 2018, 6:38am UTC](https://discuss.elastic.co/t/parse-exception/119734/1 "2018-02-14T06:38:33Z")

</div>

why I am getting this Exception to upload the Data into elastic search....? can anyone tell the reason and solution for this please...

curl -XPUT 'localhost:9200/abcfile11?pretty' -H 'Content-Type: application/json' -d'  
{  
"mappings": {  
"log": {  
"properties":  
{  
"name": {"type": "keyword"}  
"id": {"type": "integer"}  
}  
}  
}  
}  
'  
It got success but below code is rising problem

anil@anil-OptiPlex-390:~/ANIL$ curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/a2/log/\_bulk?pretty' --data-binary @abcfile11.jsonl  
Warning: Couldn't read data from file "abcfile11.jsonl", this makes an empty  
Warning: POST.  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "parse\_exception",  
"reason" : "request body is required"  
}  
],  
"type" : "parse\_exception",  
"reason" : "request body is required"  
},  
"status" : 400  
}

thanks in Advance!...

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 14, 2018, 6:39am UTC](https://discuss.elastic.co/t/parse-exception/119734/2 "2018-02-14T06:39:31Z")

</div>

What's in the file?

---

<div class="post-metadata">

**Author:** ![Anilg](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Anilg](https://discuss.elastic.co/u/Anilg)\
**Post date:** [February 14, 2018, 6:42am UTC](https://discuss.elastic.co/t/parse-exception/119734/3 "2018-02-14T06:42:00Z")

</div>

it is a abcfile11.jsonl file It has some students data id,name

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 14, 2018, 6:43am UTC](https://discuss.elastic.co/t/parse-exception/119734/4 "2018-02-14T06:43:06Z")

</div>

That doesn't explain what is _inside_ the file, the contents.  
Can you show that?

---

<div class="post-metadata">

**Author:** ![Anilg](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Anilg](https://discuss.elastic.co/u/Anilg)\
**Post date:** [February 14, 2018, 6:43am UTC](https://discuss.elastic.co/t/parse-exception/119734/5 "2018-02-14T06:43:56Z")

</div>

below is the file data

{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 9, "name" : "rasi"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" :16 , "name" : "venkatesh"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 11, "name" : "sandeep"}

{"index":{"\_index":"a2","\_type":"log"}}

{"id" : 10, "name" : "satendra"}

{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 13, "name" : "mukesh"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 14, "name" : "sairam"}

{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 1, "name" : "sekhar"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 2, "name" : "anil"}

{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 3, "name" : "durga"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 4, "name" : "sunil"}

{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 5, "name" : "kiranmai"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 6, "name" : "raviteja"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 7, "name" : "teja"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 8, "name" : "mass"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 15, "name" : "rajesh"}  
{"index":{"\_index":"a2","\_type":"log"}}  
{"id" : 12, "name" :"snr"}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 14, 2018, 7:39am UTC](https://discuss.elastic.co/t/parse-exception/119734/6 "2018-02-14T07:39:55Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Please edit your post.

2 things might happen:

- You file is not picked up by the curl command. Have a look at the curl documentation. It might differ depending on your OS.
- Here you file is incorrect. It has some blank lines in it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 14, 2018, 7:40am UTC](https://discuss.elastic.co/t/parse-exception/119734/7 "2018-03-14T07:40:04Z")

</div>

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