Elasticsearch data in Datatable

How to get the last indexed data in from the Elasticsearch data into the data table? For example, if I select the data source it fetches all the index related to particular data. What I wanted is the last indexed data.

what do you mean last indexed data? You have the time range in the upper right, you can control the time range via that time picker.

I understand. Suppose the same data is getting inserted into elasticsearch with different index then if we are interested in the current row how to filter.

For example:

index1;name=prasad;status=up;timestamp=08/31/2017 13:21
index2;name=prasad;status=down;timestamp=08/31/2017 13:22

Here to I want to display the latest data that is index2 in the table/whatever. So is there anything like max(timestamp)?

Not sure elasticsearch can do that

A quick googling returned this: https://stackoverflow.com/questions/20723379/return-the-most-recent-record-from-elasticsearch-index

Maybe can be done with the order by and size fields in Grafana.