<?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: Display result=0 rather than &amp;quot;No Results Found&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511228#M143237</link>
    <description>&lt;P&gt;The command&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where TotalErrors=0&lt;/LI-CODE&gt;&lt;P&gt;tells Splunk to show the results only if there are no errors found in the index, but if there are no errors then there's nothing to display so you get "No results found".&lt;/P&gt;&lt;P&gt;To send an alert when you have no errors, don't change the search at all.&amp;nbsp; Just change the alert to trigger when the number of results is zero.&lt;/P&gt;&lt;P&gt;If you really want a zero when there are no results, then try &lt;FONT face="courier new,courier"&gt;appendpipe&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=sp_dev  "ProductHandler" 
| rex field=message "operation\\\":\\\"(?&amp;lt;ErrorMessage&amp;gt;[A-Za-z]+)\\\""
| stats count(ErrorMessage) as TotalErrors
| appendpipe [ stats count(ErrorMessage) | eval TotalErrors=0 | where count=0 | fields - count ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2020 20:56:46 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-07-27T20:56:46Z</dc:date>
    <item>
      <title>Display result=0 rather than "No Results Found"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511204#M143190</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm using a query to get the total total count of&amp;nbsp; a field ( different error messages ) .&lt;BR /&gt;Here is the search and stats being displayed:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=sp_dev&amp;nbsp; "ProductHandler" | rex field=message "operation\\\":\\\"(?&amp;lt;ErrorMessage&amp;gt;[A-Za-z]+)\\\""| stats count(ErrorMessage) as TotalErrors&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TotalErrors&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;xxxx&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I want to alert a trigger , when&amp;nbsp; the error count&amp;nbsp; is "0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I use :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;index=sp_dev&amp;nbsp; "ProductHandler" | rex field=message "operation\\\":\\\"(?&amp;lt;ErrorMessage&amp;gt;[A-Za-z]+)\\\""| stats count(ErrorMessage) as TotalErrors | where&amp;nbsp;TotalErrors=0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It is not giving me&amp;nbsp; result as "0" , rather than "No Results Found" .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If&amp;nbsp; I use "where&amp;nbsp;TotalErrors&amp;gt;0" I see the results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So question is , how can I convert&amp;nbsp; &amp;nbsp;the&amp;nbsp;&amp;nbsp;"No Results Found"&amp;nbsp; to&amp;nbsp; value as "0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DD&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-panel lia-panel-standard LabelsForMessage Chrome lia-component-message-view-widget-labels"&gt;&lt;DIV class="lia-decoration-border"&gt;&lt;DIV class="lia-decoration-border-top"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-decoration-border-content"&gt;&lt;DIV&gt;&lt;DIV class="lia-panel-heading-bar-wrapper"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:44:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511204#M143190</guid>
      <dc:creator>dpdwibedy</dc:creator>
      <dc:date>2020-07-27T18:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Display result=0 rather than "No Results Found"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511228#M143237</link>
      <description>&lt;P&gt;The command&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where TotalErrors=0&lt;/LI-CODE&gt;&lt;P&gt;tells Splunk to show the results only if there are no errors found in the index, but if there are no errors then there's nothing to display so you get "No results found".&lt;/P&gt;&lt;P&gt;To send an alert when you have no errors, don't change the search at all.&amp;nbsp; Just change the alert to trigger when the number of results is zero.&lt;/P&gt;&lt;P&gt;If you really want a zero when there are no results, then try &lt;FONT face="courier new,courier"&gt;appendpipe&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=sp_dev  "ProductHandler" 
| rex field=message "operation\\\":\\\"(?&amp;lt;ErrorMessage&amp;gt;[A-Za-z]+)\\\""
| stats count(ErrorMessage) as TotalErrors
| appendpipe [ stats count(ErrorMessage) | eval TotalErrors=0 | where count=0 | fields - count ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 20:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511228#M143237</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-27T20:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Display result=0 rather than "No Results Found"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511234#M143240</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;, Thanks much . That worked.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 21:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-result-0-rather-than-quot-No-Results-Found-quot/m-p/511234#M143240</guid>
      <dc:creator>dpdwibedy</dc:creator>
      <dc:date>2020-07-27T21:36:29Z</dc:date>
    </item>
  </channel>
</rss>

