Elasticsearch Output Script - Append to array

We have a JDBC input that brings in records, we would like this to do one of two things depending on certain scenarios.

If there is already an array in the master record in Elasticsearch (let's say fieldA.fieldB.fieldC.array) then append this new record to that array.
If there is not already an array in the master record, then create the array (fieldA.fieldB.fieldC.array) and add this new record to that array, in this scenario it's possible that fieldA or fieldA.fieldB or fieldA.fieldB.fieldC might not exist at that time either.

Any help would be appreciated

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