Sorting in KQL

Hi, I know I can sort in Elastic api and in kibana, but now I have to use an api which only have KQL input which it encodes in base64 and send to elasticsearch. (external service)

I've tried all instances of id: desc``sort id desc. the response is completely random within the range.

You can sort on Numeric or Date fields in Discover by clicking the triangles on the column heading. (after selecting the field)

You also need to turn timestamp sorting off the same way

This is a common misunderstanding, so we've clarified this in the KQL docs. KQL is used only for filtering, and sorting is done by whichever app you are using KQL inside of.

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