Kibana -- Transform / Window / Rank not working in Vega v2

Hi,

My Vega code seems not working. I'm using Vega v2. I copied the sample online for window transform => rank operation, but the "rank" field is not showing up. I put a tooltip for field "exe" to show that it actually has a value. Please advise what is going wrong... This is driving me crazy!

{
  $schema: https://vega.github.io/schema/vega-lite/v2.json
  config: {
    kibana: {
      tooltips: {centerOnMark: true, position: "top", padding: 20}
    }
  }
  data: {
    url: {
      %context%: true
      %timefield%: @timestamp
      index: *
      body: {
        size: 10000
        _source: ["@timestamp", "end_time", "step_path", "execution_duration"]
      }
    }
    format: {property: "hits.hits"}
  }
  transform: [
    {calculate: "datum._source.step_path", as: "Step"}
    {calculate: "datum._source.execution_duration", as: "Duration(ms)"}
    {filter: "datum._source.step_path != null"}
    {
      aggregate: [
        {op: "average", format: ".2f", field: "Duration(ms)", as: "exe"}
      ]
      groupby: ["Step"]
    }
    {
      window: [
        {op: "rank", as: "rank"}
      ]
      sort: [
        {field: "exe", order: "descending"}
      ]
      groupby: ["Step"]
    }
  ]
  mark: {type: "bar"}
  encoding: {
    y: {
      field: Step
      type: ordinal
      axis: {title: "Step"}
    }
    x: {field: "rank", type: "ordinal"}
    tooltip: {field: "exe", type: "nominal"}
    color: {field: "Step", type: "nominal", "nominalColorRange ": "category10"}
  }
}

Hi @perryparktung,

I really need to see the data that you are trying to plot. Without it it would be very hard to debug the issue. Could you use JSON.stringify(VEGA_DEBUG.vegalite_spec) command from the browser debug tool (console) to copy your graph including the data, and attach it as a zip file to the issue? Make sure to expand the output to include everything.

Thanks!

Got the same issue in Kibana 6.3. Couldn't make it work even with the official Vega-Lite example: https://vega.github.io/vega-lite/docs/window.html#top-k - got kibana.bundle.js?v=16602:1 WARN Ignoring an invalid transform: {"sort":[{"field":"score","order":"descending"}],"window":[{"as":"rank","op":"rank"}]}.

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