<?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 Show a message even when no events are returned using Sttats with by clause in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494937#M137958</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have situation where I want to show a message instead of empty cell.&lt;/P&gt;

&lt;P&gt;I am using below query to get some data:&lt;/P&gt;

&lt;P&gt;somesearch | rex field=msg "ErrorCode\\":(?\d+)&lt;EM&gt;"&lt;BR /&gt;&lt;BR /&gt;
| eval Status= case(StatusCode==200,"UP",1=1,"DOWN") &lt;BR /&gt;
| eval Core=upper(substr(cf_scp_name,-3)) &lt;BR /&gt;
| stats latest(Status) as Status , dc(host) as noOfInstances by cf_app_name, Core&lt;BR /&gt;
| eval noOfInstances = case(Status=="UP", noOfInstances, 1=1, 0)&lt;BR /&gt;
| eval Status= Status + " (" + noOfInstances +")"&lt;BR /&gt;
| table cf_app_name, Core,Status&lt;BR /&gt;
| eval {Core}=Status &lt;BR /&gt;
| fields - Core, Status &lt;BR /&gt;
| stats values(&lt;/EM&gt;) as * by cf_app_name &lt;/P&gt;

&lt;P&gt;and getting results in as shown in below image&lt;/P&gt;

&lt;P&gt;here for some of the components I don't have any events in splunk. So I want to show it as down. how can I achieve this ?&lt;/P&gt;

&lt;P&gt;Thank in advance.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/280754-splunkanswers.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:54:04 GMT</pubDate>
    <dc:creator>rkmaggidi</dc:creator>
    <dc:date>2020-09-30T03:54:04Z</dc:date>
    <item>
      <title>Show a message even when no events are returned using Sttats with by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494937#M137958</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have situation where I want to show a message instead of empty cell.&lt;/P&gt;

&lt;P&gt;I am using below query to get some data:&lt;/P&gt;

&lt;P&gt;somesearch | rex field=msg "ErrorCode\\":(?\d+)&lt;EM&gt;"&lt;BR /&gt;&lt;BR /&gt;
| eval Status= case(StatusCode==200,"UP",1=1,"DOWN") &lt;BR /&gt;
| eval Core=upper(substr(cf_scp_name,-3)) &lt;BR /&gt;
| stats latest(Status) as Status , dc(host) as noOfInstances by cf_app_name, Core&lt;BR /&gt;
| eval noOfInstances = case(Status=="UP", noOfInstances, 1=1, 0)&lt;BR /&gt;
| eval Status= Status + " (" + noOfInstances +")"&lt;BR /&gt;
| table cf_app_name, Core,Status&lt;BR /&gt;
| eval {Core}=Status &lt;BR /&gt;
| fields - Core, Status &lt;BR /&gt;
| stats values(&lt;/EM&gt;) as * by cf_app_name &lt;/P&gt;

&lt;P&gt;and getting results in as shown in below image&lt;/P&gt;

&lt;P&gt;here for some of the components I don't have any events in splunk. So I want to show it as down. how can I achieve this ?&lt;/P&gt;

&lt;P&gt;Thank in advance.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/280754-splunkanswers.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:54:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494937#M137958</guid>
      <dc:creator>rkmaggidi</dc:creator>
      <dc:date>2020-09-30T03:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Show a message even when no events are returned using Sttats with by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494938#M137959</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;... | fillnull value="DOWN"&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 12:59:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494938#M137959</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-01-23T12:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Show a message even when no events are returned using Sttats with by clause</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494939#M137960</link>
      <description>&lt;P&gt;Thank you very much. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 05:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-a-message-even-when-no-events-are-returned-using-Sttats/m-p/494939#M137960</guid>
      <dc:creator>rkmaggidi</dc:creator>
      <dc:date>2020-01-24T05:22:18Z</dc:date>
    </item>
  </channel>
</rss>

