All Apps and Add-ons

Splunk OneshotSearch takes more time in Java SDK

spadhi
Engager

Hi
I have a requirement, whereI have to call Splunk search queries using java SDK.
I am using service.oneshotSearch(searchQuery, oneshotSearchArgs);
and ResultsReaderJson to read the json data.
However it takes more than 5 minutes to get the data from Splunk and it takes 10 sec to retrieve the data using splunk UI.
My search query returns around 90 records as result.
Can you please help me here to understand whats wrong?
Sample code
Args oneshotSearchArgs = new Args();
oneshotSearchArgs.put(SearchMode.OUTPUT_MODE.getMode(), OutputMode.JSON);
oneshotSearchArgs.put("count", 0);
inputstream is = service.oneshotSearch("myquery here", oneshotSearchArgs);
//this line takes morethan 5 minutes to execute
ResultsReaderJson resultsReader = new ResultsReaderJson(run);

Appreciate a quick help here.

Tags (2)
0 Karma

santhoshpriyan
New Member

Hi spadhi,

I am also facing the same issue, did any solution resolved this? if so please help me.

Thanks,
Santhoshpriyan
santhoshpriyan@gmail.com

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...