Kibana 5.4 bucket_script visualization


(Keith Pinson) #1

I can run this query through the Dev Tools in Kibana 5.4, but I cannot find any way to build a visualization off it:

{
  "query": {
    "constant_score": {
      "filter": {
        "match": {
          "activitytype": "pickPut"
        }
      }
    }
  },
  "aggs": {
    "byName": {
      "terms": {
        "field": "username.keyword",
        "size": 10
      },
      "aggs": {
        "total_picks": {
          "sum": {
            "field": "quantity"
          }
        },
        "total_loggedin_time": {
          "sum": {
            "field": "durationInSeconds"
          }
        },
        "computeRatio": {
          "bucket_script": {
            "buckets_path": {
              "picks": "total_picks",
              "time": "total_loggedin_time"
            },
            "script": "params.picks / params.time * 3600"
          }
        }
      }
    }
  }
}

I cannot figure out how to create a bucket script aggregation through Kibana 5.4, despite the inclusion of pipeline aggregations. This is a little confusing given that there is a request for it on GitHub, which is closed a dupe of the pipelines aggregation feature request, but in the description of why that was closed, it does not seem that the pipeline aggregations that were implemented include the bucket script one.

Am I understanding rightly that there is no way to visualize this query in Kibana 5.4?


Support for scripted metrics in data tables and visualisations
(Matt Bargar) #2

I agree, I've reopened the ticket.


(system) #3

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