# Creating a pipeline aggregation as given in the official doc using Kibana

**URL:** <https://discuss.elastic.co/t/creating-a-pipeline-aggregation-as-given-in-the-official-doc-using-kibana/145839>\
**Category:** Kibana\
**Created:** [August 24, 2018, 6:01am UTC](https://discuss.elastic.co/t/creating-a-pipeline-aggregation-as-given-in-the-official-doc-using-kibana/145839 "2018-08-24T06:01:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Utane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_utane/32/27547_2.png) [@Nikhil\_Utane](https://discuss.elastic.co/u/Nikhil_Utane)\
**Post date:** [August 24, 2018, 6:01am UTC](https://discuss.elastic.co/t/creating-a-pipeline-aggregation-as-given-in-the-official-doc-using-kibana/145839/1 "2018-08-24T06:01:37Z")

</div>

Hi,

I am looking to create a visualization for the example given [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html)

```auto
POST /_search
{
    "aggs": {
        "my_date_histo":{
            "date_histogram":{
                "field":"timestamp",
                "interval":"day"
            },
            "aggs":{
                "the_sum":{
                    "sum":{ "field": "lemmings" } 
                },
                "the_movavg":{
                    "moving_avg":{ "buckets_path": "the_sum" } 
                }
            }
        }
    }
}

```

Using my data I tried to get the request message as same as above. However the closest I could come to is to get the moving average of "\_count". Sample image attached.  
How do I create the visualization to mirror the same request as above?

 ![Pipeline-agg-query](https://us1.discourse-cdn.com/elastic/original/3X/2/3/23ea7fe9b39e7212e070cf547ab9481f13ff7c3b.png) -Thanks  
Nikhil

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [August 24, 2018, 9:38am UTC](https://discuss.elastic.co/t/creating-a-pipeline-aggregation-as-given-in-the-official-doc-using-kibana/145839/2 "2018-08-24T09:38:29Z")

</div>

Hello Nikhil,

You can change the Count from your second metric to a Sum instead of Count and then set the field that you want the sum for.

---

<div class="post-metadata">

**Author:** ![Nikhil\_Utane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikhil_utane/32/27547_2.png) [@Nikhil\_Utane](https://discuss.elastic.co/u/Nikhil_Utane)\
**Post date:** [August 27, 2018, 4:28am UTC](https://discuss.elastic.co/t/creating-a-pipeline-aggregation-as-given-in-the-official-doc-using-kibana/145839/3 "2018-08-27T04:28:08Z")

</div>

Jeez, I dunno what I was thinking. Perhaps had a brain freeze. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 24, 2018, 4:28am UTC](https://discuss.elastic.co/t/creating-a-pipeline-aggregation-as-given-in-the-official-doc-using-kibana/145839/4 "2018-09-24T04:28:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
