I have an Array with multiple json objects that I want to break them into multiple Arrays based on the number of json objects. Each Array should not contain more than 10 objects as an example.
[{object-1}, {object-2},....,{object-n}]
Array-1 = [{object-1}, ....,{object-10}]
Array-2 = [{object-11}, ....,{object-21}]
Array-3 = [{object-22}, {object-22}]
Looking into the actual Data note the EventsSelectors Array below. What I am looking for is to extract all the objects in the EventSelectors and breaks them into multiple arrays of EventsSelectors for later processing. Max number of Records should not exceed 20 records.
{
"EventSelectors": [
{
"IncludeManagementEvents": true,
"DataResources": [],
"ReadWriteType": "All"
},
{
"IncludeManagementEvents": true,
"DataResources": [],
"ReadWriteType": "All"
},
{
"IncludeManagementEvents": true,
"DataResources": [],
"ReadWriteType": "All"
}
],
"TrailARN": "arn:aws:cloudtrail:us-east-2:123456789012:trail/TrailName"
}
Thanks