Application Framework Reference

Splunk API

setBaseSearch()

The setBaseSearch() method replaces the current base search string with the specified search string. This method is the primary interface for setting the base search string. This method also undefines fullSearchWithIntentions and savedSearchName .

Note: You should not call this method against a search where the job has already been dispatched. Use isJobDispatched() to check the dispatch status.

Synopsis

setBaseSearch( search )

Parameters

search

Object

Search string to be set as new base search string.

Return Value

Undefined

Example

var context = this.getContext();
var search  = context.get("search");
search.setBaseSearch('search index=_internal  head 100');
context.set('search', search);
return context;
 

See Also

getBaseSearch()
isJobDispatched()
Splunk.Context