client/splunk.js
function(query, params, callback) {
            // If someone called us with the default style of (params, callback),
            // lets make it work
            if (utils.isObject(query) && utils.isFunction(params) && !callback) {
                callback = params;
                params = query;
                query = params.search;
            }
            
            callback = callback || function() {};
            params = params || {};
            params.search = query; 
            params.exec_mode = "oneshot";
            
            if (!params.search) {
                callback("Must provide a query to create a search job");
            }
            
            var outputMode = params.output_mode || "json_rows";
            
            var path = this.qualifiedPath;
            var method = "POST";
            var headers = {};
            var post = params;
            var get = {output_mode: outputMode};
            var body = null;
            
            var req = this.service.request(
                path, 
                method, 
                get, 
                post, 
                body, 
                headers, 
                function(err, response) {
                    if (err) {
                        callback(err);
                    } 
                    else {
                        callback(null, response.data);
                    }
                }
            );
            
            return req;
        }
function(query, params, callback) {
            // If someone called us with the default style of (params, callback),
            // lets make it work
            if (utils.isObject(query) && utils.isFunction(params) && !callback) {
                callback = params;
                params = query;
                query = params.search;
            }
            
            callback = callback || function() {};
            params = params || {};
            params.search = query; 
            params.exec_mode = "oneshot";
            
            if (!params.search) {
                callback("Must provide a query to create a search job");
            }
            
            var outputMode = params.output_mode || "json_rows";
            
            var path = this.qualifiedPath;
            var method = "POST";
            var headers = {};
            var post = params;
            var get = {output_mode: outputMode};
            var body = null;
            
            var req = this.service.request(
                path, 
                method, 
                get, 
                post, 
                body, 
                headers, 
                function(err, response) {
                    if (err) {
                        callback(err);
                    } 
                    else {
                        callback(null, response.data);
                    }
                }
            );
            
            return req;
        }
function ( query , params , callback ) { // If someone called us with the default style of (params, callback), // lets make it work if ( utils . isObject ( query ) && utils . isFunction ( params ) && ! callback ) { callback = params ; params = query ; query = params . search ; } callback = callback || function ( ) { } ; params = params || { } ; params . search = query ; params . exec_mode = "oneshot" ; if ( ! params . search ) { callback ( "Must provide a query to create a search job" ) ; } var outputMode = params . output_mode || "json_rows" ; var path = this . qualifiedPath ; var method = "POST" ; var headers = { } ; var post = params ; var get = { output_mode : outputMode } ; var body = null ; var req = this . service . request ( path , method , get , post , body , headers , function ( err , response ) { if ( err ) { callback ( err ) ; } else { callback ( null , response . data ) ; } } ) ; return req ; }
Creates a oneshot search from a given search query and parameters.

@example

var jobs = service.jobs();
jobs.oneshotSearch("search ERROR", {id: "myjob_123"}, function(err, results) {
console.log("RESULT FIELDS": results.fields);
});

@param {String} query The search query.
@param {Object} params A dictionary of properties for the search:
- `output_mode` (_string_): Specifies the output format of the results (XML, JSON, or CSV).
- `earliest_time` (_string_): Specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
- `latest_time` (_string_): Specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
- `rf` (_string_): Specifies one or more fields to add to the search.
@param {Function} callback A function to call with the results of the search: `(err, results)`.

@endpoint search/jobs
@method splunkjs.Service.Jobs
Creates a oneshot search from a given search query and parameters .