<?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: Null Search Swapper in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343635#M101807</link>
    <description>&lt;P&gt;@jababin...Glad that it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 19:22:42 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-03-09T19:22:42Z</dc:date>
    <item>
      <title>Null Search Swapper</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343632#M101804</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;When using the "Null Search Swapper" functionality with code like the one we can find in the "Splunk 6.x Dashboard Examples" app&lt;BR /&gt;
( /en-US/app/simple_xml_examples/null_search_swapper?form.index_switcher=index%3D_internal&amp;amp;earliest=0&amp;amp;latest= )&lt;/P&gt;

&lt;P&gt;So:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;progress&amp;gt;
            &amp;lt;condition match="$job.resultCount$ == 0"&amp;gt;
              &amp;lt;set token="show_html"&amp;gt;foob&amp;lt;/set&amp;gt;
            &amp;lt;/condition&amp;gt;
            &amp;lt;condition&amp;gt;
              &amp;lt;unset token="show_html"/&amp;gt;
            &amp;lt;/condition&amp;gt;
          &amp;lt;/progress&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;chart rejects="$show_html$"&amp;gt;
        &amp;lt;title&amp;gt;Top sourcetypes for index=_internal&amp;lt;/title&amp;gt;
        &amp;lt;search base="search_logic" /&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;bar&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
      &amp;lt;html depends="$show_html$"&amp;gt;
         &amp;lt;p style="color:blue;margin-left:30px;font-size:14px"&amp;gt;Search returned no results, so we've hidden the chart!&amp;lt;/p&amp;gt;
      &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The HTML part is displayed until the search finish and return something (if it return something). Is there a way to show the html only when the search is finished and nothing has been found ?&lt;/P&gt;

&lt;P&gt;My problem is that I've some search taking several seconds, and if user don't wait, they may think there is no result and close the page. They don't have anything to see that the query is in progress&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:09:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343632#M101804</guid>
      <dc:creator>jebabin</dc:creator>
      <dc:date>2020-09-29T13:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Null Search Swapper</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343633#M101805</link>
      <description>&lt;P&gt;Can you please try these couple of options?&lt;/P&gt;

&lt;P&gt;1) Change from &lt;CODE&gt;&amp;lt;progress&amp;gt;&lt;/CODE&gt; to &lt;CODE&gt;&amp;lt;done&amp;gt;&lt;/CODE&gt; search event handler. All other code remains the same.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Viz/EventHandlerReference#done"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Viz/EventHandlerReference#done&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;2) In your existing search change condition from &lt;CODE&gt;match="$job.resultCount$ == 0"&lt;/CODE&gt; to &lt;CODE&gt;match="$job.resultCount$ &amp;gt;0"&lt;/CODE&gt;&lt;BR /&gt;
and swap the depends and reject between chart and html panel i.e.&lt;BR /&gt;
&lt;CODE&gt;&amp;lt;chart rejects="$show_html$"&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;html depends="$show_html$"&amp;gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 14:15:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343633#M101805</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-09T14:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Null Search Swapper</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343634#M101806</link>
      <description>&lt;P&gt;Thanks,  is what I was missing, thanks for the doc link that I had not found!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 17:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343634#M101806</guid>
      <dc:creator>jebabin</dc:creator>
      <dc:date>2017-03-09T17:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Null Search Swapper</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343635#M101807</link>
      <description>&lt;P&gt;@jababin...Glad that it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 19:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Null-Search-Swapper/m-p/343635#M101807</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-09T19:22:42Z</dc:date>
    </item>
  </channel>
</rss>

