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. |
callback | Function | A function to call when done creating the search job: |
run: function(args, callback) {
if (utils.isUndefined(callback)) {
callback = args;
args = {};
}
if (!args || Object.keys(args).length === 0) {
args = {};
}
// If tstats is undefined, use pivotSearch (try to run an accelerated search if possible)
this.service.search(this.tstatsSearch || this.pivotSearch, args, callback);
}
});