# Sort on specific keyword in Discover using KQL

**URL:** https://discuss.elastic.co/t/sort-on-specific-keyword-in-discover-using-kql/259948
**Category:** Kibana
**Tags:** kql-kibana-query-language
**Created:** [December 31, 2020, 9:58am UTC](https://discuss.elastic.co/t/sort-on-specific-keyword-in-discover-using-kql/259948 "2020-12-31T09:58:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dontask](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@dontask](https://discuss.elastic.co/u/dontask)
#### Post date: [December 31, 2020, 9:58am UTC](https://discuss.elastic.co/t/sort-on-specific-keyword-in-discover-using-kql/259948/1 "2020-12-31T09:58:28Z")

</div>

Hello,

I would like to sort on a specific (ascending / descending) on a column matching a specific keyword.  
The column is returning OK or ERROR and I would like the ERROR to be on top instead of the OK, but I still want to see all the OK in my query (that's why I don't exclude the OK).

Does anyone know how can I do that? It seems like I can only sort on the time column.  
For information, the column I want to sort on is a keyword.

My Kibana version is 7.5.1

Thanks for your help!

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [December 31, 2020, 6:12pm UTC](https://discuss.elastic.co/t/sort-on-specific-keyword-in-discover-using-kql/259948/2 "2020-12-31T18:12:04Z")

</div>

You didn't specify which part of Kibana you want to sort in. I assume you are talking about Discover: Discover lets you sort by any field if you click the "add" button on the left side menu. For example if you have a column named `status` you can click the "add/+" button to create a status column, and then sort.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 28, 2021, 6:12pm UTC](https://discuss.elastic.co/t/sort-on-specific-keyword-in-discover-using-kql/259948/3 "2021-01-28T18:12:17Z")

</div>

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