Hi,
I have this requirement of dumping big JSON file with over 700K records into ES directly. However the JSON I have is formatted in PRETTY array format as below:
STRING 1:
indent preformatted text by 4 spaces
[
{
"recordId": 1,
"FirstName": "Julie",
"LastName": "Klier",
"FullName": null,
"email": "asdasd@gmail.com",
"name": "sd fghgfh",
"company": null,
"leadsource": "MOT",
"status": "Qualified",
"site_id__c": "155731983",
"createdDate": "2019-08-13T20:41:34",
"sf_lead": [],
"sf_contact": [
{
"id": "0031I00000tjNCxQAM",
"accountid": null,
"lastname": null,
"firstname": null,
"name": "Julie Klier",
"email": "sadsad@gmail.com",
"leadsource": "MOT",
"createddate": "2019-08-13T20:41:34Z",
"site_id__c": "155731983",
"asi__c": null
}
],
"sf_account": [],
"sf_oppurtunity": [
{
"id": "0061I00000J4DZWQA3",
"contactid__c": null
}
],
"sf_campaign": [
{
"id": "7013u000000mlLyAAI"
}
],
"asidta_customer": [],
"asidta_ordrhist": [],
"asidta02_customer": [],
"asidta02_ordrhist": [],
"asidta04_customer": [],
"asidta04_ordrhist": [],
"asidta05_customer": [],
"asidta05_ordrhist": []
}
]
Now I want to convert this into below format:
STRING 2:
{"index":{"_index":"allreportingdata","_id":1}}
{
"recordId": 1,
"FirstName": "Julie",
"LastName": "Klier",
"FullName": null,
"email": "asdasd@gmail.com",
"name": "sd fghgfh",
"company": null,
"leadsource": "MOT",
"status": "Qualified",
"site_id__c": "155731983",
"createdDate": "2019-08-13T20:41:34",
"sf_lead": [],
"sf_contact": [
{
"id": "0031I00000tjNCxQAM",
"accountid": null,
"lastname": null,
"firstname": null,
"name": "Julie Klier",
"email": "sadsad@gmail.com",
"leadsource": "MOT",
"createddate": "2019-08-13T20:41:34Z",
"site_id__c": "155731983",
"asi__c": null
}
],
"sf_account": [ ],
"sf_oppurtunity": [
{
"id": "0061I00000J4DZWQA3",
"contactid__c": null
}
],
"sf_campaign": [
{
"id": "7013u000000mlLyAAI"
}
],
"asidta_customer": [],
"asidta_ordrhist": [],
"asidta02_customer": [],
"asidta02_ordrhist": [],
"asidta04_customer": [],
"asidta04_ordrhist": [],
"asidta05_customer": [],
"asidta05_ordrhist": []
}
Can someone please help me to achieve this? Also what is this STRING 2 called ?