On This Page

Home / Search/ Language Reference/ Functions/ Context Functions/latestTime

latestTime ​

The latestTime function returns the end of the current search’s time range, expressed as a Unix timestamp in seconds.

To get the start of the search’s time range, use earliestTime().

Syntax ​

latestTime()

Arguments ​

None.

Returns ​

A long containing the Unix timestamp, in seconds, of the end of the search’s time range.

Examples ​

Compute the rate of events per second across the search’s time window:

dataset=myDataset
|| summarize eventsPerSecond = count() / (latestTime() - earliestTime()) by host

Annotate each result with the boundaries of the search’s time range:

dataset=myDataset
|| extend window_start=earliestTime(), window_end=latestTime()
|| export to lake myAuditDataset