Overall average line in a chart

Hi,
I am creating a chart in Timelion to show a bar chart with the amount of docs (requests) per day. In this chart I would like to add a horizontal line with the average of docs per day over all buckets. I can determine this average using pipeline aggregations. But I would really like to do this in Timelion. Does anyone have an idea how to do this? Below is the query I can use to obtain the avg_daily_visits.

GET raw_events-*/_search
{
  "size": 0,
  "aggs": {
    "by_day": {
      "date_histogram": {
        "field": "createDate",
        "interval": "day"
      }
    },
    "avg_daily_visists": {
      "avg_bucket": {
        "buckets_path": "by_day>_count" 
      }
    }
  }
}

This isn't currently possible with Timelion. However it is something we are working on at the moment.

And when @shaunak says "at the moment" he literally meant at this extra very moment. Like now. Like here it is:

For Kibana 4.x:

For Kibana 5:

See the README.md for installation instructions. I didn't publish a package for them, but installing from Github is easier than frosting a cupcake. Which, I guess if don't bake much, might seem intimidating, but I assure you, both installing that plugin and frosting a cupcake are very easy.

Plus, you get a bonus function, .orderby() which orders a multi-series list by one of the same functions as .aggregate(), or by the label of the series.

Enjoy.

Cool, going to try it, I'll figure out later on what is easier. Baking the cup cake or adding it to my installation :slight_smile:

I got the following warning when doing what is stated in the readme:

log [17:58:24.801] [warning] Plugin "timelion-extras" was disabled because it expected Kibana version "0.1.0", and found "5.0.0-rc1".

As it turns out, you have to change the version in the package.json from 0.1.0 to the version you are using. 5.0.0-rc1 in my case. Then restart Kibana and it worked perfectly for me. I am happy :slight_smile:

Whoops, missed that. I updated the README.md, thanks!