Application Framework Reference

Splunk API

getCursorTime()

Cursor time is the time after which no events have been scanned. Cursor time can be used to indicate job progress, where:

doneProgress = (latestTime - cursorTime) / (latestTime - earliestTime)

The getCursorTime() method gets the current job cursor time.

Note: For searches distributed over multiple search heads, this is the latest cursor time of all searches.

Synopsis

time = getCursorTime()

Return Value

false = Cursor time not yet set.
Date() object = Cursor time.

Example

var context = this.getContext();
var search = context.get('search');
var cursorTime = search.job.getCursorTime();

if (cursorTime == false)
   console.log('Job cursor time not set.');
else
   console.log('Current job cursor time is ' + cursorTime.toString());
 

See Also

Date()
getDoneProgress()