<?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 Count table value pair in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235641#M175913</link>
    <description>&lt;P&gt;I have a table like this derive from search&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2325iAC4E3D29F3362DCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
I need to have it formatted like this. Like counting the username-device pair occurance&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2326i2D9A1529F27B0D74/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Also, how do call this kind of table (field value pair?).. just so next time i know what to search&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 07:08:54 GMT</pubDate>
    <dc:creator>splunkmata</dc:creator>
    <dc:date>2017-01-11T07:08:54Z</dc:date>
    <item>
      <title>Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235641#M175913</link>
      <description>&lt;P&gt;I have a table like this derive from search&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2325iAC4E3D29F3362DCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
I need to have it formatted like this. Like counting the username-device pair occurance&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2326i2D9A1529F27B0D74/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Also, how do call this kind of table (field value pair?).. just so next time i know what to search&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 07:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235641#M175913</guid>
      <dc:creator>splunkmata</dc:creator>
      <dc:date>2017-01-11T07:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235642#M175914</link>
      <description>&lt;P&gt;Hi splunkmata, &lt;/P&gt;

&lt;P&gt;Please try the following search commands following the search string that produced your table: &lt;BR /&gt;
    ... | stats count by USERNAME, DEVICE | stats list(DEVICE) as DEVICE, list(count) as count&lt;/P&gt;

&lt;P&gt;Hope this helps. Thanks!&lt;BR /&gt;
Hunter&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 14:38:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235642#M175914</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-11T14:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235643#M175915</link>
      <description>&lt;P&gt;Sorry, correction - missing by DEVICE at the end: &lt;BR /&gt;
    ... | stats count by USERNAME, DEVICE | stats list(DEVICE) as DEVICE, list(count) as count by DEVICE&lt;/P&gt;

&lt;P&gt;Thanks!&lt;BR /&gt;
Hunter&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 14:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235643#M175915</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-11T14:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235644#M175916</link>
      <description>&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| stats count by USERNAME, DEVICE|eval deviceCount=DEVICE+" - "+count | stats list(deviceCount) as deviceCount by USERNAME|rex field=deviceCount "(?&amp;lt;DEVICE&amp;gt;.*) - (?&amp;lt;COUNT&amp;gt;.*)"|fields - deviceCount
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jan 2017 14:45:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235644#M175916</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-11T14:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235645#M175917</link>
      <description>&lt;P&gt;Hi hunter,&lt;BR /&gt;
thanks for the input.&lt;/P&gt;

&lt;P&gt;got this error when i pipe your stat to my query&lt;BR /&gt;
&lt;STRONG&gt;Error in 'stats' command: The output field 'DEVICE' cannot have the same name as a group-by field.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 04:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235645#M175917</guid>
      <dc:creator>splunkmata</dc:creator>
      <dc:date>2017-01-12T04:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235646#M175918</link>
      <description>&lt;P&gt;This one did it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| stats count by USERNAME, DEVICE|eval deviceCount=DEVICE+" - "+count | stats list(deviceCount) as deviceCount by USERNAME|rex field=deviceCount "(?&amp;lt;DEVICE&amp;gt;.*) - (?&amp;lt;COUNT&amp;gt;.*)"|fields - deviceCount
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jan 2017 04:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235646#M175918</guid>
      <dc:creator>splunkmata</dc:creator>
      <dc:date>2017-01-12T04:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count table value pair</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235647#M175919</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2324iFE5BE848735E3650/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 04:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-table-value-pair/m-p/235647#M175919</guid>
      <dc:creator>splunkmata</dc:creator>
      <dc:date>2017-01-12T04:45:42Z</dc:date>
    </item>
  </channel>
</rss>

