App Framework Reference

Splunk API

Splunk.TimeRange

The Splunk.TimeRange class encapsulates the TimeRange object for storing and retrieving the time range constraining a search.

Language Binding

JavaScript

Declaration

$SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/js/time_range.js

Implementation Location

$SPLUNK_HOME/etc/apps/<appName>/appserver/modules/<moduleName>

Constructor

Methods

clone() Gets a copy of the current time range.
containsRange() Checks if the specified timeRange is contained in the current time range.
containsTime() Checks if the specified dateObj time is contained in the current time range.
equalToRange() Checks if a range time range object is equal to the current time range.
formatRelativeRange() Gets a text-formated representation of the current time range.
getAbsoluteEarliestTime() Gets the absolute earliest time of the current time range object.
getAbsoluteLatestTime() Gets the absolute latest time in the current time range object.
getDuration() Gets the interval between the current time range earliest and latest times.
getEarliestTimeTerms() Gets the earliest time since the epoch.
getLatestTimeTerms() Gets the latest time since the epoch.
getRelativeEarliestTime() Gets the earliest time of the relative current time range. A private method.
getRelativeLatestTime() Gets the latest time of the relative current time range. A private method.
getTimeFormat() Gets a formatted absolute time used by the REST API.
isAbsolute() Tests if the earliest and latest times are absolute.
isAllTime() Tests if the time range is "all time," unbounded earliest and latest time.
isRealTime() Tests if the current time range is a real-time representation.
isRelative() Tests if the current time range is relative.
isSubRangeOfJob() Checks if the current time range is a sub-range of the underlying job.
setAsSubRangeOfJob() Indicates the current time range is a subset of the underlying job time range.
toConciseString() Gets a compact, localized time range in human-readable form.
toString() Serializes the current time range.