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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...