Script processor ingest pipelines on nested fields

The lists of objects will simply be Painless lists in the script, so you can iterate over them just like any other list. This case is especially straightforward using Streams, e.g.:

POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {
        "script": {
          "source": """
          ctx.interesting_avg = ctx.things.stream()
            .mapToInt(thing -> thing.interesting)
            .average()
            .orElse(0)
          """
        }
      }
    ]
  },
  "docs": [
    {
      "_source": {
        "things": [
          {
            "interesting": 35
          },
          {
            "interesting": 42
          },
          {
            "interesting": 12
          }
        ]
      }
    }
  ]
}

Which returns:

{
  "docs" : [
    {
      "doc" : {
        "_index" : "_index",
        "_type" : "_type",
        "_id" : "_id",
        "_source" : {
          "things" : [
            {
              "interesting" : 35
            },
            {
              "interesting" : 42
            },
            {
              "interesting" : 12
            }
          ],
          "interesting_avg" : 29.666666666666668
        },
        "_ingest" : {
          "timestamp" : "2019-03-13T22:40:27.030Z"
        }
      }
    }
  ]
}

Does that help you?