Skip to content

Cumilative Sum doesn't work with other pipeline aggregations #27544

Closed
@simianhacker

Description

@simianhacker

Cumulative sum aggregation returns an error when using it with other pipeline aggregations. This happens consistently with both bucket_scripts and derivatives.

Steps to Reproduce:

  1. Index some Metricbeat data
  2. Run the following query:
GET metricbeat-*/_search
{
  "size": 0,
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-15m/m",
        "lte": "now"
      }
    }
  },
  "aggs": {
    "timeseries": {
      "date_histogram": {
        "field": "@timestamp",
        "interval": "10s"
      },
      "aggs": {
        "maxTX": {
          "max": {
            "field": "system.network.out.bytes"
          }
        },
        "calculation": {
          "bucket_script": {
            "buckets_path": {
              "maxTX": "maxTX"
            }, 
            "script": { 
              "source": "params.maxTX" 
            }
          }
        },
        "cumsum": {
          "cumulative_sum": {
            "buckets_path": "calculation"
          }
        }
      }
    }
  }
}
  1. Receive following response:
{
  "error": {
    "root_cause": [],
    "type": "search_phase_execution_exception",
    "reason": "",
    "phase": "fetch",
    "grouped": true,
    "failed_shards": [],
    "caused_by": {
      "type": "null_pointer_exception",
      "reason": null
    }
  },
  "status": 503
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions