Sort Results in Discovery Kibana (KQL)

Hello, I have a database about flights and I want to create a coordinate map, so I need the last entry of each flight.

I'm new to Elastic and Kibana, I don't know about how to do it.

In this example, I filtered by the ICAO, and I got 5 entries. I want to sort by date and get the last one, so I will have a new discover list without repeated ICAOs, only with the last one.

hi @Jesus_Moyano_Dona

So you're not able to do this filtering in Discover, and you would not be able to create this map in the Coordinate map visualization.

Your use-case is supported by the Maps-application.

What you need is top-hits (showing last location per icao). This is supported by the Maps-app.

Details see here: https://www.elastic.co/guide/en/kibana/current/maps-top-hits-aggregation.html

In the Maps-app, click "Add layer", choose "Documents". Then choose "show top hits by entity", and then select 1 for size. Make sure to order-descending by time in the "Sort" card.

It'd look something like:

Imagine "host.keyword" is "icao" in your example.

Also, make sure the positiongeohash field is actually indexed as geo_point into elasticsearch. https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html

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