<?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 Counting values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Counting-values/m-p/29128#M177894</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
i have a key value pair say FTYPE=VAL1 and FTYPE=VAL2 and create a timechart with&lt;/P&gt;

&lt;P&gt;earliest=-1d@d latest=now | timechart &lt;BR /&gt;
count(eval(FTYPE=VAL1)) as TYPE1, count(eval(FTYPE="VAL2")) as TYPE2&lt;/P&gt;

&lt;P&gt;All for sudden i notice that the expected numbers are wrong because some of the FTYPE values are blank like FTYPE= &lt;/P&gt;

&lt;P&gt;How can i create the timechart where blank FTYPE values are treated as VAL1? I tried something like &lt;BR /&gt;
count(eval(FTYPE=VAL1 OR FTYPE="")) as TYPE1&lt;/P&gt;

&lt;P&gt;somehow that doesn't work either.&lt;/P&gt;

&lt;P&gt;Any ideas? Many thanks ...&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2013 18:05:36 GMT</pubDate>
    <dc:creator>mkrauss1</dc:creator>
    <dc:date>2013-02-12T18:05:36Z</dc:date>
    <item>
      <title>Counting values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-values/m-p/29128#M177894</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
i have a key value pair say FTYPE=VAL1 and FTYPE=VAL2 and create a timechart with&lt;/P&gt;

&lt;P&gt;earliest=-1d@d latest=now | timechart &lt;BR /&gt;
count(eval(FTYPE=VAL1)) as TYPE1, count(eval(FTYPE="VAL2")) as TYPE2&lt;/P&gt;

&lt;P&gt;All for sudden i notice that the expected numbers are wrong because some of the FTYPE values are blank like FTYPE= &lt;/P&gt;

&lt;P&gt;How can i create the timechart where blank FTYPE values are treated as VAL1? I tried something like &lt;BR /&gt;
count(eval(FTYPE=VAL1 OR FTYPE="")) as TYPE1&lt;/P&gt;

&lt;P&gt;somehow that doesn't work either.&lt;/P&gt;

&lt;P&gt;Any ideas? Many thanks ...&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2013 18:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-values/m-p/29128#M177894</guid>
      <dc:creator>mkrauss1</dc:creator>
      <dc:date>2013-02-12T18:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Counting values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-values/m-p/29129#M177895</link>
      <description>&lt;P&gt;You test for null like this : isnull(field)&lt;BR /&gt;
So your search would be :&lt;/P&gt;

&lt;P&gt;FTYPE=VAL1 OR isnull(FTYPE)&lt;/P&gt;

&lt;P&gt;or, you could jsut do this beforehand :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval FTYPE=if(isnull(FTYPE),"VAL1",FTYPE) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2013 18:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-values/m-p/29129#M177895</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-02-12T18:31:15Z</dc:date>
    </item>
  </channel>
</rss>

