Sorting string column in Kibana visualization

1.3k Views Asked by At

I have a status field in my elastic search index which can take values Open,Closed,Clear,Intermediate,Ready for Approval. Right now, I have created a visualization and sorted this field descending based on the Term. What I want to achieve is - I want this to be sorted in this particular order Open,Clear,Intermediate,Ready for Approval,Closed.

How do I achieve this? One option I am thinking is creating a scripted field and prefixing with integer column, but I am not sure if I will be able to filter the visualization later?

1

There are 1 best solutions below

0
On

If this list of possible values is a static list of known values, there is another way to define your visualization with a little more manual configuration. Just replace your terms aggregation with a filters aggregation and add custom filters for the possible values like so:

Kibana 5 Filters aggregation for status

Kibana will respect the order of your filters in the visualization. From a performance perspective, this should also be better than using a scripted field...