Datatable config case help

Assuming i have data as follow in ES,
type status
a new
a wip
b new
b new
a done

then i need a data-table in Kibana 5.0,
type new wip done
a 1 1 1
b 2 0 0

I add agg for type first, then tried add split rows and tables. can not get the result i need.

any suggestion would be appreciate.

Hi Joodies,

I'm guessing a and b are values of type
and new, wip, and done are values of status

So you're trying to create a data table with terms across the top and down the side. Unfortunately Kibana can't do that (yet). But I came up with a hack of a work-around.

I create test data using the Dev Tools console like this;

PUT index1/type1/1
{
  "type": "a",
  "status": "new"
}

PUT index1/type1/2
{
  "type": "a",
  "status": "wip"
}

PUT index1/type1/3
{
  "type": "b",
  "status": "new"
}

PUT index1/type1/4
{
  "type": "b",
  "status": "new"
}

PUT index1/type1/5
{
  "type": "a",
  "status": "done"
}

Then I created an index pattern in Kibana for index1.
Then I created 3 scripted fields by going on that index pattern so that I would have a field for each of those status values that are either 1 or 0;

Then I created the Data Table visualization as shown below;

Regards,
Lee

1 Like

Wow, you are the best!
Thought scripted field would be slow, but tried with 5 million rows, still can be done in 1 second.
Very good inspiration from you, thanks.

Btw, I just published a blog on Painless in Kibana scripted fields with examples and best practices: https://www.elastic.co/blog/using-painless-kibana-scripted-fields

1 Like

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