Sum array length

Hi, this should be a simple thing to accomplish but I couldn’t figure out how to do this in Grafana.
Given an index with documents that contain an array, how can I visualize with a graph the sum of the arrays’ length, given time? I already know how to write an ElasticSearch aggregation to accomplish this, but couldn’t figure out how to recreate it within Grafana:

 {
"query": { "match_all": {}},
 "aggs": {
    "HISTOGRAM": {
      "date_histogram": {
        "interval": "5s",
        "field": "timestamp",
        "min_doc_count": 1,
        "extended_bounds": {
          "min": "1590401307829",
          "max": "1590404907829"
        },
        "format": "epoch_millis"
      },
      "aggs": {
        "SUM_LENGTH": {
          "sum": {
            "script": {
              "inline": "doc['my_array'].length"
            }
          }
        }
      }
    }
  }

Just to clarify, I am aware that the Sum aggregation exists as one of the options when creating the query for a specific graph, however the ‘field’ property is mandatory. As a result of adding it, I am getting abnormally high values for some reason, not sure why…

Any help would be appreciated! :smile:

is it solved? i am looking for something similar