<?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: Can you help me search to return results even if there are none available? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398365#M115548</link>
    <description>&lt;P&gt;@ryhluc01 try the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=example sourcetype=exp1 OR sourcetype=exp2 
| stats count by sourcetype 
| append 
    [| makeresults 
    | fields - _time 
    | eval sourcetype="exp1,exp2" 
    | makemv sourcetype delim=","
    | mvexpand sourcetype 
    | eval count=0] 
| dedup sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 14 Jan 2019 18:55:52 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2019-01-14T18:55:52Z</dc:date>
    <item>
      <title>Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398363#M115546</link>
      <description>&lt;P&gt;I have 2 source types that run every morning at 8:30am.&lt;/P&gt;

&lt;P&gt;If 1 or more does not, I need to still see the source types as having a value of 0 instead of displaying "No results found. Try expanding the time range.". &lt;/P&gt;

&lt;P&gt;Overall: I need all the specified source type names to be returned within the results so that I can assign a value of 0 to them. &lt;/P&gt;

&lt;P&gt;This is what I have: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=example sourcetype=exp1 OR sourcetype=exp2
| stats count(_time) as count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above syntax will let me know how many reports ran in the last 24 hrs at the time we specified (which is what I want). &lt;/P&gt;

&lt;P&gt;But, in the event that 1 or both or these reports fail to run, I need to still be able to see each source type within my results. &lt;/P&gt;

&lt;P&gt;I would like to assign a 0 value to the count for the source type that didn't generate any results.  &lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 16:50:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398363#M115546</guid>
      <dc:creator>ryhluc01</dc:creator>
      <dc:date>2019-01-14T16:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398364#M115547</link>
      <description>&lt;P&gt;Are you wanting to do this in a dashboard on inline in a search?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 18:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398364#M115547</guid>
      <dc:creator>zonistj</dc:creator>
      <dc:date>2019-01-14T18:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398365#M115548</link>
      <description>&lt;P&gt;@ryhluc01 try the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=example sourcetype=exp1 OR sourcetype=exp2 
| stats count by sourcetype 
| append 
    [| makeresults 
    | fields - _time 
    | eval sourcetype="exp1,exp2" 
    | makemv sourcetype delim=","
    | mvexpand sourcetype 
    | eval count=0] 
| dedup sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Jan 2019 18:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398365#M115548</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-01-14T18:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398366#M115549</link>
      <description>&lt;P&gt;inline search&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398366#M115549</guid>
      <dc:creator>ryhluc01</dc:creator>
      <dc:date>2019-01-14T19:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398367#M115550</link>
      <description>&lt;P&gt;@niketnilay  You're amazing. This worked perfectly. Thank you so much for your input ^_^ &lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:10:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398367#M115550</guid>
      <dc:creator>ryhluc01</dc:creator>
      <dc:date>2019-01-14T19:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398368#M115551</link>
      <description>&lt;P&gt;Glad you found this working!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 21:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398368#M115551</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-01-14T21:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me search to return results even if there are none available?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398369#M115552</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=example sourcetype=exp1 OR sourcetype=exp2 
| stats count(_time) as total_count eval(count(sourcetype="exp1") as ex1_count eval(count(sourcetype="exp2")) as ex2_count by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is another tweak you can employ in your search &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 11:04:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-search-to-return-results-even-if-there-are-none/m-p/398369#M115552</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2019-04-09T11:04:51Z</dc:date>
    </item>
  </channel>
</rss>

