<?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: Count by column with clausule where and fill with 0 if not found in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303330#M91272</link>
    <description>&lt;P&gt;Works fine for me thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 06:02:45 GMT</pubDate>
    <dc:creator>miki73</dc:creator>
    <dc:date>2017-10-12T06:02:45Z</dc:date>
    <item>
      <title>Count by column with clausule where and fill with 0 if not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303328#M91270</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
So situation is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by col1 | where col1 IN ("tmp1", "tmp2", "tmp3")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and i call this for last 5 min, but sometimes for example "tmp1" is not happen in last 5 min so i want to put into my list value like &lt;/P&gt;

&lt;P&gt;col1    count&lt;BR /&gt;
tmp1  0&lt;BR /&gt;
tmp2 5&lt;BR /&gt;
tmp3 10&lt;/P&gt;

&lt;P&gt;After that i want to create from this a chart so i need to include values with count=0 to analize. &lt;BR /&gt;
anyone know how to handle that situation ?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303328#M91270</guid>
      <dc:creator>miki73</dc:creator>
      <dc:date>2017-10-11T11:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count by column with clausule where and fill with 0 if not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303329#M91271</link>
      <description>&lt;P&gt;Something like this, should work.  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count by col1 | appendpipe [tail 1 | eval col1=mvappend("tmp1", "tmp2", "tmp3") | eval count=0] | mvexpand col1 | stats max(count) as count by col1| where col1 IN ("tmp1", "tmp2", "tmp3")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If the list is too big, its better to put them in a lookup table and use append command.&lt;/P&gt;

&lt;P&gt;link for lookup solution.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/580763/help-needed-with-a-search-and-a-lookup.html#answer-582032"&gt;https://answers.splunk.com/answers/580763/help-needed-with-a-search-and-a-lookup.html#answer-582032&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 16:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303329#M91271</guid>
      <dc:creator>kyaparla</dc:creator>
      <dc:date>2017-10-11T16:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count by column with clausule where and fill with 0 if not found</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303330#M91272</link>
      <description>&lt;P&gt;Works fine for me thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 06:02:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-by-column-with-clausule-where-and-fill-with-0-if-not-found/m-p/303330#M91272</guid>
      <dc:creator>miki73</dc:creator>
      <dc:date>2017-10-12T06:02:45Z</dc:date>
    </item>
  </channel>
</rss>

