<?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 Running realtime search using the java sdk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154315#M2111</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;When using the realtime api to search is have noticed that unless you do a extra Thread.Sleep(xxx);&lt;BR /&gt;
after the job.isReady loop you get an empty stream.&lt;/P&gt;

&lt;P&gt;I use the com.splunk.examples.search_realtime.Program as an example.&lt;BR /&gt;
.....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;while (!job.isReady()) {
    try {
        Thread.sleep(100);
    } catch (InterruptedException e) {
        // You shouldn't ever get here.
    }
}
// extra sleep to make sure Splunk returns a event stream.
try {
    Thread.sleep(2000);
} catch (InterruptedException e1) {
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In another process I continuously ingest tweet events into an index, but they are not showing up when running the Program unless the extra Thread.sleep for some secs.&lt;/P&gt;

&lt;P&gt;I'm using the latest 1.2.1.0 sdk to test. and Splunk 6 + max osx&lt;/P&gt;</description>
    <pubDate>Sun, 24 Nov 2013 16:45:08 GMT</pubDate>
    <dc:creator>preben12</dc:creator>
    <dc:date>2013-11-24T16:45:08Z</dc:date>
    <item>
      <title>Running realtime search using the java sdk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154315#M2111</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;When using the realtime api to search is have noticed that unless you do a extra Thread.Sleep(xxx);&lt;BR /&gt;
after the job.isReady loop you get an empty stream.&lt;/P&gt;

&lt;P&gt;I use the com.splunk.examples.search_realtime.Program as an example.&lt;BR /&gt;
.....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;while (!job.isReady()) {
    try {
        Thread.sleep(100);
    } catch (InterruptedException e) {
        // You shouldn't ever get here.
    }
}
// extra sleep to make sure Splunk returns a event stream.
try {
    Thread.sleep(2000);
} catch (InterruptedException e1) {
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In another process I continuously ingest tweet events into an index, but they are not showing up when running the Program unless the extra Thread.sleep for some secs.&lt;/P&gt;

&lt;P&gt;I'm using the latest 1.2.1.0 sdk to test. and Splunk 6 + max osx&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2013 16:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154315#M2111</guid>
      <dc:creator>preben12</dc:creator>
      <dc:date>2013-11-24T16:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Running realtime search using the java sdk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154316#M2112</link>
      <description>&lt;P&gt;Try this : &lt;A href="https://gist.github.com/damiendallimore/6363236"&gt;https://gist.github.com/damiendallimore/6363236&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 05:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154316#M2112</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2013-11-25T05:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Running realtime search using the java sdk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154317#M2113</link>
      <description>&lt;P&gt;Hi Damien&lt;BR /&gt;
That looks doable, but with a couple of pitfalls since loops that contain Thread.sleeps have to be guarded by the possibility to break the loop when you want to stop the search thread from outside.&lt;/P&gt;

&lt;P&gt;Somehow I feel that the SDK should take care of this eg. by fixing the isReady method so it returns when the stream is ready (there is at least 1 preview event, or there is no events in the current time window).&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 18:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Running-realtime-search-using-the-java-sdk/m-p/154317#M2113</guid>
      <dc:creator>preben12</dc:creator>
      <dc:date>2013-11-25T18:41:56Z</dc:date>
    </item>
  </channel>
</rss>

