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

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
}

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

Thanks, Issue resolved.

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