<?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: How to display count as zero when no events are returned in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/689390#M234923</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got the solution to this. We need to first create results and initialize the count as 0. it will create one table with 4 rows. Then join that with the other lookup files. Below is the query that I have used:&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval threat_key="p_default_domain_risklist_hrly"&lt;BR /&gt;| eval count=0&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval threat_key="p_default_hash_risklist_hrly"&lt;BR /&gt;| eval count=0 ]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval threat_key="p_default_ip_risklist_hrly"&lt;BR /&gt;| eval count=0]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval threat_key="p_default_url_risklist_hrly"&lt;BR /&gt;| eval count=0 ]&lt;BR /&gt;| fields - _time&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup ip_intel&lt;BR /&gt;| search threat_key=*risklist_hrly*&lt;BR /&gt;| stats count by threat_key ]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup file_intel&lt;BR /&gt;| search threat_key=*risklist_hrly*&lt;BR /&gt;| stats count by threat_key&lt;BR /&gt;]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup http_intel&lt;BR /&gt;| search threat_key=*risklist_hrly*&lt;BR /&gt;| stats count by threat_key ]&lt;BR /&gt;| stats sum(count) as count by threat_key&lt;BR /&gt;| search count=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2024 09:35:00 GMT</pubDate>
    <dc:creator>493600</dc:creator>
    <dc:date>2024-06-03T09:35:00Z</dc:date>
    <item>
      <title>How to display count as zero when no events are returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688334#M234679</link>
      <description>&lt;P&gt;I have three lookup files and I am trying to find out which one has a zero count.&lt;/P&gt;
&lt;P&gt;Below is the query I am using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup file_intel
| inputlookup append=true ip_intel
| inputlookup append=true http_intel
| search threat_key=*risklist_hrly*
| stats count by threat_key

&lt;/LI-CODE&gt;
&lt;P&gt;I want to know which threat_key has a zero count for threat_key=*risklist_hrly*. I have tried fillnull, its not working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can only see the one that has count. I want to get the one that has zero count.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="493600_0-1716384237230.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30920iB0FAB17D51633449/image-size/medium?v=v2&amp;amp;px=400" role="button" title="493600_0-1716384237230.png" alt="493600_0-1716384237230.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 16:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688334#M234679</guid>
      <dc:creator>493600</dc:creator>
      <dc:date>2024-05-22T16:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to display count as zero when no events are returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688339#M234680</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/35653"&gt;@493600&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup file_intel
| stats count BY threat_key
| eval count=0
| append [ | inputlookup ip_intel | eval count=0 | fields threat_key count ]
| append [ | inputlookup http_intel | eval count=0 | fields threat_key count ]
| stats sum(count) AS total BY threat_key
| search threat_key=*risklist_hrly*&lt;/LI-CODE&gt;&lt;P&gt;if in all lookups there's a field called "threat_key".&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 13:34:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688339#M234680</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-22T13:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to display count as zero when no events are returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688419#M234700</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response but this doesn't work. Its making all the count 0 when we add | eval count=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 08:48:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688419#M234700</guid>
      <dc:creator>493600</dc:creator>
      <dc:date>2024-05-23T08:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to display count as zero when no events are returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688429#M234703</link>
      <description>&lt;LI-CODE lang="markup"&gt;| inputlookup file_intel
| stats count BY threat_key
| eval lookup=1
| append [ | inputlookup ip_intel | stats count BY threat_key | eval lookup=2 | fields threat_key lookup ]
| append [ | inputlookup http_intel | stats count BY threat_key | eval lookup=4 | fields threat_key lookup ]
| stats sum(lookup) AS mask BY threat_key
| search threat_key=*risklist_hrly*&lt;/LI-CODE&gt;&lt;P&gt;if mask is 7 the key is in all files&lt;/P&gt;&lt;P&gt;if it is 6 it is in ip_intel and http_intel&lt;/P&gt;&lt;P&gt;if it is 5 it is in file_intel and http_intel&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 09:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/688429#M234703</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-05-23T09:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to display count as zero when no events are returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/689390#M234923</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got the solution to this. We need to first create results and initialize the count as 0. it will create one table with 4 rows. Then join that with the other lookup files. Below is the query that I have used:&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval threat_key="p_default_domain_risklist_hrly"&lt;BR /&gt;| eval count=0&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval threat_key="p_default_hash_risklist_hrly"&lt;BR /&gt;| eval count=0 ]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval threat_key="p_default_ip_risklist_hrly"&lt;BR /&gt;| eval count=0]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval threat_key="p_default_url_risklist_hrly"&lt;BR /&gt;| eval count=0 ]&lt;BR /&gt;| fields - _time&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup ip_intel&lt;BR /&gt;| search threat_key=*risklist_hrly*&lt;BR /&gt;| stats count by threat_key ]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup file_intel&lt;BR /&gt;| search threat_key=*risklist_hrly*&lt;BR /&gt;| stats count by threat_key&lt;BR /&gt;]&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup http_intel&lt;BR /&gt;| search threat_key=*risklist_hrly*&lt;BR /&gt;| stats count by threat_key ]&lt;BR /&gt;| stats sum(count) as count by threat_key&lt;BR /&gt;| search count=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 09:35:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/689390#M234923</guid>
      <dc:creator>493600</dc:creator>
      <dc:date>2024-06-03T09:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to display count as zero when no events are returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/689393#M234924</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/35653"&gt;@493600&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 10:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-count-as-zero-when-no-events-are-returned/m-p/689393#M234924</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-03T10:03:51Z</dc:date>
    </item>
  </channel>
</rss>

