Application Framework Reference

Splunk API

equalToSearch()

The equalToSearch() method tests if a context current search is equal to the specified search, where the following properties are equivalent in both objects:

  • Search string
  • Job ID
  • Dispatch state
  • Intentions
  • Time range
  • Remote servers list
  • Event count
  • Post process

Synopsis

equal = equalToSearch( search )

Parameters

search

Object

Search object to compare to current context search object.

Return Value

Boolean

Equivalent search object indication:

True = Search objects are equal.

False = Search objects are not equal.

Example

var context = this.getContext();var search = context.get('search');
if (search.equalToSearch(this._previousSearch)) {
    alert('search has not changed!');
    return true;
} else {
    alert('search has changed!');
    return false;
}
 

See Also

Splunk.Context
Splunk.Job
Splunk.Module
Splunk.TimeRange