<?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 values for two fields like a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221797#M188181</link>
    <description>&lt;P&gt;What does the example you provide &lt;CODE&gt;| stats count(key1), count(key2) by value&lt;/CODE&gt; do that's incorrect?  Can you provide a sample of 5 or 10 events and the actual results/totals you'd get using those 5 or 10 events?&lt;/P&gt;

&lt;P&gt;Thanks - that would go a long ways toward helping everyone understand the issue, which would go a long ways toward getting some possible answers.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Nov 2015 16:59:39 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2015-11-07T16:59:39Z</dc:date>
    <item>
      <title>Count by values for two fields like a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221796#M188180</link>
      <description>&lt;P&gt;I have events coming with two distinct key say "Key1" and "Key2".  Expected value for these keys are  1 to 3.  I want a table where I can see the count of each key for every possible value like...&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;     |     &lt;STRONG&gt;count(Key1)&lt;/STRONG&gt;      |     &lt;STRONG&gt;count( Key2)&lt;/STRONG&gt;&lt;BR /&gt;
1         |         10                 |              3&lt;BR /&gt;
2         |          1                  |              15&lt;BR /&gt;
3         |          4                  |              6&lt;/P&gt;

&lt;P&gt;tried "| stats count(key1), count(key2) by value" but that doesn't work&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 21:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221796#M188180</guid>
      <dc:creator>nkotha</dc:creator>
      <dc:date>2015-11-06T21:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count by values for two fields like a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221797#M188181</link>
      <description>&lt;P&gt;What does the example you provide &lt;CODE&gt;| stats count(key1), count(key2) by value&lt;/CODE&gt; do that's incorrect?  Can you provide a sample of 5 or 10 events and the actual results/totals you'd get using those 5 or 10 events?&lt;/P&gt;

&lt;P&gt;Thanks - that would go a long ways toward helping everyone understand the issue, which would go a long ways toward getting some possible answers.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2015 16:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221797#M188181</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-11-07T16:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Count by values for two fields like a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221798#M188182</link>
      <description>&lt;P&gt;This was another fun one!  Like this (If confused, look at the results without each of the last 2 lines):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...  | multireport
        [ stats count AS "count(Key1)" BY Key1 ]
        [ stats count AS "count(Key2)" BY Key2 ]
     | eval Value=coalesce(Key1, Key2)
     | fields - Key* | stats first(*) AS * BY Value
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Nov 2015 21:53:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-by-values-for-two-fields-like-a-table/m-p/221798#M188182</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-07T21:53:44Z</dc:date>
    </item>
  </channel>
</rss>

