Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* Oneshot search, no job is created exec_mode = oneshot , blocking
*/
public static void oneshotBlockingSearchExample() {
Service splunkService = connectAndLoginToSplunkExample();
String searchQuery = "search index=_internal * | head 1";
JobArgs queryArgs = new JobArgs();
queryArgs.setEarliestTime("-1d@d");
queryArgs.setLatestTime("now");
// perform the blocking search
InputStream stream = splunkService.oneshotSearch(searchQuery, queryArgs);
// process results
printRawResults(stream);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.