Sort field Using Kibana

(Aditya Patel) #1


I was wondering how to go about sorting one field wrt another field. Suppose we have two fields in our object.
1 {
id: x1
val : 3 }
id: x2
val : 4 }
Can we sort id's as x2,x1 (wrt val in this scenario) in kibana?


(Tanya Bragin) #2

Sure, just add both to a data table and search by either header from there

(Aditya Patel) #3

Thanks it worked !

(Aditya Patel) #4

Also if i want metric but by a query in elasticsearch , how would i go about it.

I tried following query but it's throwing an error.

GET /index/table/_search/
"sort": [
"x1": {"order" : "asc"}
"query": {
"term": { "id" }

Thanks in advance

(Tanya Bragin) #5

All aggregations and sorting are configured via the visual builder in the UI. The search bar can accept query DSL for the purposes of filtering the documents, but only the query/filter part of the DSL.

Check out this thread for such an example: Where to add a missing filter in this Kibana search

(Aditya Patel) #6

Thanks. Currently i want to port either the dashboard completely to my website or get the metric table data from the elasticsearch via query , aggregation (I am not sure which needs to be used), so i can use it.

Thanks again for the patience and help. :blush:

(system) closed #7