<?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 ignore empty fields in a split in stats/tstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176206#M50602</link>
    <description>&lt;P&gt;This doesn't actually work. Per docs:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Tstats"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Tstats&lt;/A&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The tstats command is a generating command. Generating commands use a leading pipe character. The tstats command must be the first command in a search pipeline, except when (append=true).&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;As such, to answer above will not work.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2016 21:31:22 GMT</pubDate>
    <dc:creator>dshpritz</dc:creator>
    <dc:date>2016-03-03T21:31:22Z</dc:date>
    <item>
      <title>How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176204#M50600</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to find the cardinality of the fields for my indexes. The problem is that some fields sometimes have a value and sometimes they don't, so when I split with tstats/stats using the "by" clause, if one of the fields is empty, it returns nothing.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=summary by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;works perfectly. But if I add the field "asset" which for the last 7 days has had no values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=summary by host, asset
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it returns "No results found".&lt;/P&gt;

&lt;P&gt;How can  I make Splunk ignore that "asset" field so if it's empty it shows the data with rest of the splits?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 16:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176204#M50600</guid>
      <dc:creator>mciudad</dc:creator>
      <dc:date>2015-08-17T16:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176205#M50601</link>
      <description>&lt;P&gt;This is exactly what the fillnull command is for.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fillnull asset | tstats count where index=summary by host, asset
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Aug 2015 16:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176205#M50601</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-17T16:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176206#M50602</link>
      <description>&lt;P&gt;This doesn't actually work. Per docs:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Tstats"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/SearchReference/Tstats&lt;/A&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The tstats command is a generating command. Generating commands use a leading pipe character. The tstats command must be the first command in a search pipeline, except when (append=true).&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;As such, to answer above will not work.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 21:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176206#M50602</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2016-03-03T21:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176207#M50603</link>
      <description>&lt;P&gt;i've unaccepted this Answer per discussion,  woodcock is going to give it another crack &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 20:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176207#M50603</guid>
      <dc:creator>piebob</dc:creator>
      <dc:date>2016-03-14T20:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176208#M50604</link>
      <description>&lt;P&gt;You can solve this in a two-step search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=summary asset=* by host, asset | append [tstats count where index=summary NOT asset=* by host | eval asset = "n/a"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For regular &lt;CODE&gt;stats&lt;/CODE&gt; you can indeed use &lt;CODE&gt;fillnull&lt;/CODE&gt; as suggested by woodcock.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 20:15:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176208#M50604</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-14T20:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176209#M50605</link>
      <description>&lt;P&gt;I downvoted this post because just realized this is great for stats (i use it all the time) but not for tstats, which is what is being discussed.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 23:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176209#M50605</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2016-03-14T23:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176210#M50606</link>
      <description>&lt;P&gt;saved a lot of headache on a stats query - thx a lot!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 06:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176210#M50606</guid>
      <dc:creator>claudio_manig</dc:creator>
      <dc:date>2017-10-06T06:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to ignore empty fields in a split in stats/tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176211#M50607</link>
      <description>&lt;P&gt;Yes, I sometimes answer both without reading closely and without testing.  I did not notice the &lt;CODE&gt;t&lt;/CODE&gt; in front of `stats.  Everyone commenting is quite correct.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 19:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-ignore-empty-fields-in-a-split-in-stats-tstats/m-p/176211#M50607</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-10-07T19:06:52Z</dc:date>
    </item>
  </channel>
</rss>

