# Unable to post nested json data using bulk api in an index refering docs (Elasticsearch 7.8)

**URL:** <https://discuss.elastic.co/t/unable-to-post-nested-json-data-using-bulk-api-in-an-index-refering-docs-elasticsearch-7-8/240446>\
**Category:** Elasticsearch\
**Created:** [July 9, 2020, 4:20am UTC](https://discuss.elastic.co/t/unable-to-post-nested-json-data-using-bulk-api-in-an-index-refering-docs-elasticsearch-7-8/240446 "2020-07-09T04:20:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akash\_Gusain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akash_gusain/32/71848_2.png) [@Akash\_Gusain](https://discuss.elastic.co/u/Akash_Gusain)\
**Post date:** [July 9, 2020, 4:20am UTC](https://discuss.elastic.co/t/unable-to-post-nested-json-data-using-bulk-api-in-an-index-refering-docs-elasticsearch-7-8/240446/1 "2020-07-09T04:20:45Z")

</div>

I am new to elastic, post data using bulk api but unable to send nested data.  
can any body help where i am wrong.

POST \_bulk  
{"index":{"\_index" : "network\_data", "\_id" : "1"}}  
{"predictionDate": "16-07-2019",  
"category": "General",  
"siteId": "S2189",  
"cellName": "S2189A12",  
"kpi": "lte\_5510a",  
"dataUplink": {  
"value": 7.79,  
"high": "true"  
},  
"dataDownlink": {  
"value": 60,  
"high": true  
},  
"voiceTraffic": {  
"value": 6.61,  
"low": true  
},  
"next7DaysPrediction": "Going to Degrade"  
}  
{"index":{"\_index" : "network\_data","\_id":"2"}}  
{"predictionDate": "16-07-2019",  
"category": "General",  
"siteId": "S3375",  
"cellName": "S3375A12",  
"kpi": "lte\_5510a",  
"dataUplink": {  
"value": 1.05,  
"high": "true"  
},  
"dataDownlink": {  
"value": 25.5,  
"medium": true  
},  
"voiceTraffic": {  
"value": 2.74,  
"low": true  
},  
"next7DaysPrediction": "Going to Degrade"  
}{"index":{"\_index" : "network\_data","\_id":"3"}}  
{"predictionDate": "16-07-2019",  
"category": "General",  
"siteId": "S3375",  
"cellName": "S3375A12",  
"kpi": "lte\_5510a",  
"dataUplink": {  
"value": 1.05,  
"high": "true"  
},  
"dataDownlink": {  
"value": 25.5,  
"medium": true  
},  
"voiceTraffic": {  
"value": 2.74,  
"low": true  
},  
"next7DaysPrediction": "Going to Degrade"  
}{"index":{"\_index" : "network\_data","\_id":"4"}}  
{"predictionDate": "16-07-2019",  
"category": "General",  
"siteId": "S0295",  
"cellName": "S0295E13",  
"kpi": "lte\_5670a",  
"dataUplink": {  
"value": 0.92,  
"medim": "true"  
},  
"dataDownlink": {  
"value": 10,  
"up": true  
},  
"voiceTraffic": {  
"value": 6.18,  
"medium": true  
},  
"next7DaysPrediction": "Going to Degrade"  
}

getting error below

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "illegal\_argument\_exception",  
"reason" : "Malformed action/metadata line [3], expected START\_OBJECT but found [VALUE\_STRING]"  
}  
],  
"type" : "illegal\_argument\_exception",  
"reason" : "Malformed action/metadata line [3], expected START\_OBJECT but found [VALUE\_STRING]"  
},  
"status" : 400  
}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 9, 2020, 4:33am UTC](https://discuss.elastic.co/t/unable-to-post-nested-json-data-using-bulk-api-in-an-index-refering-docs-elasticsearch-7-8/240446/2 "2020-07-09T04:33:16Z")

</div>

Each document need to be on a single line so your bulk request formatting seems incorrect.

---

<div class="post-metadata">

**Author:** ![Akash\_Gusain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akash_gusain/32/71848_2.png) [@Akash\_Gusain](https://discuss.elastic.co/u/Akash_Gusain)\
**Post date:** [July 14, 2020, 7:33am UTC](https://discuss.elastic.co/t/unable-to-post-nested-json-data-using-bulk-api-in-an-index-refering-docs-elasticsearch-7-8/240446/3 "2020-07-14T07:33:14Z")

</div>

Thanks, Issue resolved.

---

<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:** [August 11, 2020, 7:33am UTC](https://discuss.elastic.co/t/unable-to-post-nested-json-data-using-bulk-api-in-an-index-refering-docs-elasticsearch-7-8/240446/4 "2020-08-11T07:33:20Z")

</div>

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