How to add average or sum buckets to terms aggregation?

Viewed 21

I made query with two terms aggregation, and also I tried to each of them a new aggregation for average or sum. For example: I want to search average of "agg1", and sum of "agg2". Is it possible to make it separately? Here is my query:

{
  "aggs": {
    "agg1": {
      "terms": {
        "field": "destination.bytes"
      },
      "aggs": {
        "agg2": {
          "terms": {
            "field": "source.bytes"
          }
        }
      }
    }
  }
}
0 Answers
Related