<?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: SplunkJS: How to check if the search is currently running with Javascript? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430991#M123211</link>
    <description>&lt;P&gt;Great, thanks! I checked the properites and there is value I needed.&lt;/P&gt;

&lt;P&gt;search.on('search:progress', function(properties){ console.log(properties.content.isDone) })&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 09:58:02 GMT</pubDate>
    <dc:creator>seva98</dc:creator>
    <dc:date>2019-06-21T09:58:02Z</dc:date>
    <item>
      <title>SplunkJS: How to check if the search is currently running with Javascript?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430989#M123209</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have an issue in my project code, something runs a function that starts multiple searches- multiple times.&lt;BR /&gt;&lt;BR /&gt;
I will need to make simple checks, where I check if a search with 'searchid' is currently running and if so I will just  &lt;CODE&gt;return else&lt;/CODE&gt;  and start the search. &lt;BR /&gt;
Is it possible?&lt;/P&gt;

&lt;P&gt;For example, I will need something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var search = mvc.Components.getInstance('searchid')
if (search.isRunning) {
 return
} else {
 // Start search
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know how to run the search but I don't know how to check if it is currently running.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 08:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430989#M123209</guid>
      <dc:creator>seva98</dc:creator>
      <dc:date>2019-06-21T08:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS: How to check if the search is currently running with Javascript?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430990#M123210</link>
      <description>&lt;P&gt;Hello @seva98,&lt;/P&gt;

&lt;P&gt;Here's an example for you :&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEVT"&gt;http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAEVT&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if that's what you're looking for !&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 09:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430990#M123210</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-21T09:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS: How to check if the search is currently running with Javascript?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430991#M123211</link>
      <description>&lt;P&gt;Great, thanks! I checked the properites and there is value I needed.&lt;/P&gt;

&lt;P&gt;search.on('search:progress', function(properties){ console.log(properties.content.isDone) })&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 09:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430991#M123211</guid>
      <dc:creator>seva98</dc:creator>
      <dc:date>2019-06-21T09:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS: How to check if the search is currently running with Javascript?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430992#M123212</link>
      <description>&lt;P&gt;Awesome ! glad to know it helped &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 10:34:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SplunkJS-How-to-check-if-the-search-is-currently-running-with/m-p/430992#M123212</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-21T10:34:09Z</dc:date>
    </item>
  </channel>
</rss>

