<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java sdk Splunk queries performance challenge in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99949#M1213</link>
    <description>&lt;OL&gt;
&lt;LI&gt;The code is set up to dispatch the saved search in the event that the history is empty. That is probably why you are still getting results.&lt;/LI&gt;
&lt;LI&gt;After you login into Splunk web, select the appropriate app from the "App" drop down in the top right corner, then click on "Jobs". The URL is something like this - &lt;A href="http://$host:$port/en-US/app/$app/job_management" target="test_blank"&gt;http://$host:$port/en-US/app/$app/job_management&lt;/A&gt;. Here you should see jobs for your saved searches, assuming they are scheduled.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Tue, 29 Jan 2013 18:47:01 GMT</pubDate>
    <dc:creator>Neeraj_Luthra</dc:creator>
    <dc:date>2013-01-29T18:47:01Z</dc:date>
    <item>
      <title>Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99945#M1209</link>
      <description>&lt;P&gt;Hi, I am using JAVA SDK of Splunk and using struts2 as the framework. I have a performance challenge.&lt;BR /&gt;
Each time the page loads, the queries take too long time to execute (i have 6 of them in each page). So, I implemented Ajax.&lt;BR /&gt;
But even then, the first time the page loads - takes too long (about 30-40 seconds) (for splunk server connection and then querying the saved searches) before the user sees a response. I am using non-blocking mode of executing which was included in the website (&lt;A href="http://dev.splunk.com/view/splunk-java-sdk-how-to/SP-CAAAEKY"&gt;http://dev.splunk.com/view/splunk-java-sdk-how-to/SP-CAAAEKY&lt;/A&gt;).&lt;/P&gt;

&lt;P&gt;Could you pl suggest a better way of improving the performance.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   Job jobSavedSearch = null;

        // Run the saved search
        try {
            jobSavedSearch = savedSearch.dispatch();
            amJob.job = jobSavedSearch;
        } catch (InterruptedException e1) {
            e1.printStackTrace();
        }

        System.out.println("Waiting for the job to finish...\n");

        // Wait for the job to finish
        while (!jobSavedSearch.isDone()) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jan 2013 12:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99945#M1209</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-01-25T12:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99946#M1210</link>
      <description>&lt;P&gt;The connection to Splunk is most likely not adding any significant delay. My initial guess is that your saved searches are expensive and are taking quite some time to return.&lt;/P&gt;

&lt;P&gt;Unless these queries absolutely need to return real-time data, I would recommend scheduling these saved searches on Splunk to run at regular intervals. You can do this from the Splunk UI and pick time intervals like once a minute, hour, day, month etc., whatever suits your business need.&lt;/P&gt;

&lt;P&gt;Finally, try the following in your Java code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SavedSearch mySavedSearch = service.getSavedSearches().get("mySavedSearchName");
Job[] jobs = mySavedSearch.history();
Job myJob = null;
try {
    myJob = (jobs.length &amp;gt; 0) ? jobs[0] : mySavedSearch.dispatch();
} catch (InterruptedException e) {
    e.printStackTrace();
}
System.out.println("Waiting for the job to finish for saved search - " + mySavedSearch.getName() + " ...\n");

while (!myJob.isDone()) {
    try {
        Thread.sleep(500);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
System.out.println("Job for saved search - " + mySavedSearch.getName() + " finished.\n");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jan 2013 22:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99946#M1210</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-01-25T22:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99947#M1211</link>
      <description>&lt;P&gt;Thank you. It worked!&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jan 2013 04:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99947#M1211</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-01-26T04:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99948#M1212</link>
      <description>&lt;P&gt;I have now tried with multiple queries. There are few observations.&lt;BR /&gt;
1. I dont have scheduled search- but still am getting the results from the savedsearch with the above code. What could be the reason.&lt;BR /&gt;
2. Could you kindly clarify if there is any splunk web equivalent for the above code - how do I check from where it is getting savedsearch.history.&lt;BR /&gt;
Kindly help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 13:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99948#M1212</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-01-29T13:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99949#M1213</link>
      <description>&lt;OL&gt;
&lt;LI&gt;The code is set up to dispatch the saved search in the event that the history is empty. That is probably why you are still getting results.&lt;/LI&gt;
&lt;LI&gt;After you login into Splunk web, select the appropriate app from the "App" drop down in the top right corner, then click on "Jobs". The URL is something like this - &lt;A href="http://$host:$port/en-US/app/$app/job_management" target="test_blank"&gt;http://$host:$port/en-US/app/$app/job_management&lt;/A&gt;. Here you should see jobs for your saved searches, assuming they are scheduled.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 29 Jan 2013 18:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99949#M1213</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-01-29T18:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99950#M1214</link>
      <description>&lt;P&gt;Does usage of indexes help in improving the performance? Am just evaluating other options as well. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 08:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99950#M1214</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-02-13T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99951#M1215</link>
      <description>&lt;P&gt;That won't help. An index in Splunk is not like one in a typical RDBMS where indexes are created for performance improvement. If you have scheduled your saved searches and are still looking for further improvement, I recommend reading through the Splunk search manual - &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 08:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99951#M1215</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-02-13T08:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99952#M1216</link>
      <description>&lt;P&gt;Thank you. I see that in 5.x version of SPlunk,there is summary indexing, which seemingly is much faster. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Usesummaryindexing"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Usesummaryindexing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 09:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99952#M1216</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-02-13T09:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99953#M1217</link>
      <description>&lt;P&gt;Hi Neeraj,&lt;BR /&gt;
Thank you for the guidance. Could you kindly suggest does summary indexing help.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2013 12:17:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99953#M1217</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-02-14T12:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99954#M1218</link>
      <description>&lt;P&gt;Summary Indexing can definitely help but I suggest that you read through Report Acceleration and Summary Indexing along with their use cases at &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Aboutsummaryindexing"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Aboutsummaryindexing&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2013 16:26:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99954#M1218</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-03-14T16:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk Splunk queries performance challenge</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99955#M1219</link>
      <description>&lt;P&gt;Thank you..&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 06:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Java-sdk-Splunk-queries-performance-challenge/m-p/99955#M1219</guid>
      <dc:creator>1234testtest</dc:creator>
      <dc:date>2013-03-18T06:42:20Z</dc:date>
    </item>
  </channel>
</rss>

