Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* Simple Search exec_mode = blocking , blocking
*/
public static void simpleBlockingSearchExample() {
Service splunkService = connectAndLoginToSplunkExample();
String searchQuery = "search index=_internal * | head 1";
JobArgs queryArgs = new JobArgs();
queryArgs.setEarliestTime("-3d@d");
queryArgs.setLatestTime("-1d@d");
// perform the blocking search
Job job = splunkService.search(searchQuery, queryArgs);
InputStream stream = job.getResults();
// 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.