Constructor for a pivot. SDK users are not expected to invoke this constructor directly.
Constructor for a pivot. SDK users are not expected to invoke this constructor directly.
Name | Type | Description |
---|---|---|
service | splunkjs.Service | A |
props | Object | A dictionary of properties to set: |
init: function(service, props) {
this.service = service;
this.search = props.search;
this.drilldownSearch = props.drilldown_search;
this.prettyQuery = this.openInSearch = props.open_in_search;
this.pivotSearch = props.pivot_search;
this.tstatsSearch = props.tstats_search || null;
this.run = utils.bind(this, this.run);
},
Starts a search job running this pivot, accelerated if possible.
Name | Type | Description |
---|---|---|
args | Object | A dictionary of properties for the search job (optional). For a list of available parameters, see Search job parameters on Splunk Developer Portal. |
response_timeout | Number | A timeout period for aborting a request in milisecs (0 means no timeout). |
run: function(args, response_timeout) {
if (utils.isNumber(args) && !response_timeout) {
response_timeout = args;
args = {};
}
if (!args || Object.keys(args).length === 0) {
args = {};
}
// If tstats is undefined, use pivotSearch (try to run an accelerated search if possible)
return this.service.search(this.tstatsSearch || this.pivotSearch, args, response_timeout);
}
});