0

In my opinion, there are two ways to implement it. But I don't know which is faster, because I don't have much data to test.

Like SQL below:

SELECT min(occur_time) FROM event_*
SELECT occur_time FROM event_* order by occur_time limit 1
Brutal_JL
  • 2,839
  • 2
  • 21
  • 27

1 Answers1

0

You can run a query, with size:1, sorted by @timestamp ascending, and even include_fields:@timestamp in order to fetch back only the minimum timestamp field:

{
   "size":1,
   "sort": [{"@timestamp":"asc"}],
   "_source": {
         "includes": [ "@timestamp" ]
   }
 }