<?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 Bring back set number of fields even if the field isn't in the data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52823#M12848</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to bring back a set number of fields in a query even if that field isn't in the indexed data.  For example, my data could have a field called Status.  Status could be one of 3 values a, b, or c.  My data only happens to have a and b with no c.  I want my queries to always bring back count values for a, b, and c with 0 for any field value that's not in the current data.  Is this possible?&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2011 04:28:50 GMT</pubDate>
    <dc:creator>jlechem</dc:creator>
    <dc:date>2011-03-03T04:28:50Z</dc:date>
    <item>
      <title>Bring back set number of fields even if the field isn't in the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52823#M12848</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to bring back a set number of fields in a query even if that field isn't in the indexed data.  For example, my data could have a field called Status.  Status could be one of 3 values a, b, or c.  My data only happens to have a and b with no c.  I want my queries to always bring back count values for a, b, and c with 0 for any field value that's not in the current data.  Is this possible?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2011 04:28:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52823#M12848</guid>
      <dc:creator>jlechem</dc:creator>
      <dc:date>2011-03-03T04:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bring back set number of fields even if the field isn't in the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52824#M12849</link>
      <description>&lt;P&gt;Could you share your exact search?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2011 05:14:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52824#M12849</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-03-03T05:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bring back set number of fields even if the field isn't in the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52825#M12850</link>
      <description>&lt;P&gt;Yes it's possible, you can use the eval command under the count, it will only count if it matches a set outcome, here's a sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="some source" | stats count(eval(Status="a")) as Name_of_field_A count(eval(Status="b")) as Name_of_field_B count(eval(Status="c")) as Name_of_field_C
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above will always return the 3 fields and will stay at 0 till they encounter a match on the status field.  Is that what you're looking for?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2011 14:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52825#M12850</guid>
      <dc:creator>bbingham</dc:creator>
      <dc:date>2011-03-03T14:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Bring back set number of fields even if the field isn't in the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52826#M12851</link>
      <description>&lt;P&gt;That's exactly what I'm looking for thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2011 23:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bring-back-set-number-of-fields-even-if-the-field-isn-t-in-the/m-p/52826#M12851</guid>
      <dc:creator>jlechem</dc:creator>
      <dc:date>2011-03-04T23:58:05Z</dc:date>
    </item>
  </channel>
</rss>

