<?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 do I create a faceted, multi-filter search with counting over multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-faceted-multi-filter-search-with-counting-over/m-p/237393#M70555</link>
    <description>&lt;P&gt;I'm writing a generic search layer that allows our users to have drilldown, faceted search experience. This means that for a given set of search results, I want to see the distribution of existing values for a set of given fields, with a count of matches. This will allow the user to select one of those values and run a second search, narrowing down the results.&lt;/P&gt;

&lt;P&gt;It seems easy enough to do it for one result field, using &lt;CODE&gt;stats count&lt;/CODE&gt; or &lt;CODE&gt;chart count&lt;/CODE&gt;. The problem is that &lt;CODE&gt;count&lt;/CODE&gt;ing over multiple fields results in a narrow AND count, rather than a separate count for each different field. &lt;/P&gt;

&lt;P&gt;I've tried implementing this with subsearches - &lt;CODE&gt;search host="test" | chart count by field1 | append [search host="test" | chart count by field2]&lt;/CODE&gt; but this requires me to pass the search filters ( ( &lt;CODE&gt;host="test"&lt;/CODE&gt;) for every internal subsearch, in essence running the search &lt;STRONG&gt;n&lt;/STRONG&gt; times instead of just getting stats on a single set of search results. It might be more efficient than running &lt;STRONG&gt;n&lt;/STRONG&gt; searches from my code, but it still seems wasteful.&lt;/P&gt;

&lt;P&gt;So, is there a way to achieve this without running multiple searches? It would be even better if I can get the search &lt;EM&gt;results&lt;/EM&gt;  alongside the search &lt;EM&gt;stats&lt;/EM&gt; in a single hit.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2015 06:45:16 GMT</pubDate>
    <dc:creator>lisardggy</dc:creator>
    <dc:date>2015-11-17T06:45:16Z</dc:date>
    <item>
      <title>How do I create a faceted, multi-filter search with counting over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-faceted-multi-filter-search-with-counting-over/m-p/237393#M70555</link>
      <description>&lt;P&gt;I'm writing a generic search layer that allows our users to have drilldown, faceted search experience. This means that for a given set of search results, I want to see the distribution of existing values for a set of given fields, with a count of matches. This will allow the user to select one of those values and run a second search, narrowing down the results.&lt;/P&gt;

&lt;P&gt;It seems easy enough to do it for one result field, using &lt;CODE&gt;stats count&lt;/CODE&gt; or &lt;CODE&gt;chart count&lt;/CODE&gt;. The problem is that &lt;CODE&gt;count&lt;/CODE&gt;ing over multiple fields results in a narrow AND count, rather than a separate count for each different field. &lt;/P&gt;

&lt;P&gt;I've tried implementing this with subsearches - &lt;CODE&gt;search host="test" | chart count by field1 | append [search host="test" | chart count by field2]&lt;/CODE&gt; but this requires me to pass the search filters ( ( &lt;CODE&gt;host="test"&lt;/CODE&gt;) for every internal subsearch, in essence running the search &lt;STRONG&gt;n&lt;/STRONG&gt; times instead of just getting stats on a single set of search results. It might be more efficient than running &lt;STRONG&gt;n&lt;/STRONG&gt; searches from my code, but it still seems wasteful.&lt;/P&gt;

&lt;P&gt;So, is there a way to achieve this without running multiple searches? It would be even better if I can get the search &lt;EM&gt;results&lt;/EM&gt;  alongside the search &lt;EM&gt;stats&lt;/EM&gt; in a single hit.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 06:45:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-faceted-multi-filter-search-with-counting-over/m-p/237393#M70555</guid>
      <dc:creator>lisardggy</dc:creator>
      <dc:date>2015-11-17T06:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a faceted, multi-filter search with counting over multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-faceted-multi-filter-search-with-counting-over/m-p/237394#M70556</link>
      <description>&lt;P&gt;Would this help?&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/290287/is-it-possible-to-do-faceted-search-with-splunk-si.html"&gt;https://answers.splunk.com/answers/290287/is-it-possible-to-do-faceted-search-with-splunk-si.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 18:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-faceted-multi-filter-search-with-counting-over/m-p/237394#M70556</guid>
      <dc:creator>bemantunes</dc:creator>
      <dc:date>2015-12-10T18:22:38Z</dc:date>
    </item>
  </channel>
</rss>

