Pipeline Aggregations: Parse Failure Could not find aggregator type avg_bucket

Hi,

I am trying to query Elasticsearch to show for each week, the average count of documents per day. I understand I must use the pipeline aggregation to achieve this, however I am having an issue with it...

This is my request (that I am firing from UNIX command line):

curl -XGET '<host>:<port>/<indices>/_search' -d '
{
   "size" : 0,
   "aggs" : { 
      "weekly_agg" : {
         "date_histogram" : {
            "field" : "@timestamp",
            "interval" : "week"
         },
         "aggs" : {
            "daily_agg" : {
               "date_histogram" : {
                  "field" : "@timestamp",
                  "interval" : "day"
               }
            }
         }
      },
      "avg_monthly_daily_count" : {
         "avg_bucket" : {
            "buckets_path" : "weekly_agg>daily_agg"
         }
      }
   }
}'

Host, port, and index names are masked as above for security reasons. From this request the response boils down to:

Parse Failure [Could not find aggregator type [avg_bucket] in [avg_monthly_daily_count]]]; }]","status":400}

Unfortunately I cannot show the entire response as it reveals too much about our set up. Please let me know if you need more information.

Cheers,
Ben

I have just found that the reason of this is because pipeline aggregations requires a higher version than the one installed at the company.