<?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 How to add zeros to table when data is not found in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464900#M130989</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Have a question for the community: I have a table that looks like this:&lt;BR /&gt;
&lt;STRONG&gt;ADate                   Type &lt;BR /&gt;
2019-12-01        ABC&lt;BR /&gt;
2019-12-02        ABC&lt;BR /&gt;
2019-12-02        XYZ&lt;BR /&gt;
2019-12-03        XYZ&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;When I run ..... &lt;CODE&gt;|stats count by  A&lt;/CODE&gt; , Type-  I get only the counts of Types that are there on that date.&lt;/P&gt;

&lt;P&gt;I want to append the count of 2019-12-01 for XYZ as 0 , 2019-12-03 ABC as 0 like that in my result. &lt;BR /&gt;
Any help with this?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2019 19:53:05 GMT</pubDate>
    <dc:creator>komalg</dc:creator>
    <dc:date>2019-12-11T19:53:05Z</dc:date>
    <item>
      <title>How to add zeros to table when data is not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464900#M130989</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Have a question for the community: I have a table that looks like this:&lt;BR /&gt;
&lt;STRONG&gt;ADate                   Type &lt;BR /&gt;
2019-12-01        ABC&lt;BR /&gt;
2019-12-02        ABC&lt;BR /&gt;
2019-12-02        XYZ&lt;BR /&gt;
2019-12-03        XYZ&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;When I run ..... &lt;CODE&gt;|stats count by  A&lt;/CODE&gt; , Type-  I get only the counts of Types that are there on that date.&lt;/P&gt;

&lt;P&gt;I want to append the count of 2019-12-01 for XYZ as 0 , 2019-12-03 ABC as 0 like that in my result. &lt;BR /&gt;
Any help with this?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 19:53:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464900#M130989</guid>
      <dc:creator>komalg</dc:creator>
      <dc:date>2019-12-11T19:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add zeros to table when data is not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464901#M130990</link>
      <description>&lt;P&gt;Hi @komalg,&lt;/P&gt;

&lt;P&gt;You can use the &lt;CODE&gt;fillnull&lt;/CODE&gt; command as follows to put zeros everywhere (just like my school grades) in case your search is &lt;CODE&gt;|stats count by A&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fillnull 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But if you want to use &lt;CODE&gt;|stats count by ADate, Type-&lt;/CODE&gt; then you're actually better off going for something like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval _time=strptime(ADate,%Y-%m-%d) |timechart count by Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 20:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464901#M130990</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-11T20:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add zeros to table when data is not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464902#M130991</link>
      <description>&lt;P&gt;Thanks, stats does not work, but I am able to work with timechart.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 16:32:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-zeros-to-table-when-data-is-not-found/m-p/464902#M130991</guid>
      <dc:creator>komalg</dc:creator>
      <dc:date>2019-12-30T16:32:30Z</dc:date>
    </item>
  </channel>
</rss>

