<?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: show multiple rows per one user in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184006#M52992</link>
    <description>&lt;P&gt;The "c" is just shorthand for "count". Similarly, dc() is shorthand for distinct_count(). So, "&lt;CODE&gt;| stats c by mdm_user,error_code&lt;/CODE&gt;" and "&lt;CODE&gt;| stats count by mdm_user,error_code&lt;/CODE&gt;" would produce the same results except that the count columns would be named "c" and "count" respectively. If you pipe the results of this first stats command into something else, you just need to make sure you use either "c" or "count" depending on what you used in the stats table.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:07:04 GMT</pubDate>
    <dc:creator>gauldridge</dc:creator>
    <dc:date>2020-09-28T16:07:04Z</dc:date>
    <item>
      <title>show multiple rows per one user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184003#M52989</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have data that gives these fields: user and error code.&lt;/P&gt;

&lt;P&gt;I am trying to count the amount of certain errors PER user, so it would look like...&lt;/P&gt;

&lt;P&gt;USER----------ERROR-----COUNT&lt;/P&gt;

&lt;P&gt;user1&lt;/P&gt;

&lt;P&gt;--------------error1-----5&lt;/P&gt;

&lt;P&gt;--------------error2-----3&lt;/P&gt;

&lt;P&gt;user2&lt;/P&gt;

&lt;P&gt;--------------error1-----7&lt;/P&gt;

&lt;P&gt;--------------error3-----9&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 15:00:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184003#M52989</guid>
      <dc:creator>bcusick</dc:creator>
      <dc:date>2014-03-12T15:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple rows per one user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184004#M52990</link>
      <description>&lt;P&gt;You can do something like this to solve the problem of the double count by/group by&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | stats c by user, error | stats list(error) AS ERROR list(c) AS COUNT by USER
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result would look like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;USER      ERROR     COUNT
-------------------------
user1     error1    7
          error3    3
          error6    1
-------------------------
user2     error4    2
          error3    9
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184004#M52990</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-03-12T19:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple rows per one user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184005#M52991</link>
      <description>&lt;P&gt;what is the "c" in "stats c by user, error"...do I replace this with "count"?&lt;/P&gt;

&lt;P&gt;My fields are offically mdm_user, error_code, and I want the count of each error_code value per user.  I have a search that pulls the list of errors per user in one row so far by using | transaction mdm_user |&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184005#M52991</guid>
      <dc:creator>bcusick</dc:creator>
      <dc:date>2020-09-28T16:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple rows per one user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184006#M52992</link>
      <description>&lt;P&gt;The "c" is just shorthand for "count". Similarly, dc() is shorthand for distinct_count(). So, "&lt;CODE&gt;| stats c by mdm_user,error_code&lt;/CODE&gt;" and "&lt;CODE&gt;| stats count by mdm_user,error_code&lt;/CODE&gt;" would produce the same results except that the count columns would be named "c" and "count" respectively. If you pipe the results of this first stats command into something else, you just need to make sure you use either "c" or "count" depending on what you used in the stats table.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184006#M52992</guid>
      <dc:creator>gauldridge</dc:creator>
      <dc:date>2020-09-28T16:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple rows per one user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184007#M52993</link>
      <description>&lt;P&gt;This worked so far...however I know I am going to have to add information from a lookup table.  How can I produce multiple fields from a lookup table (on user) instead of just the stats this is giving?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 13:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184007#M52993</guid>
      <dc:creator>bcusick</dc:creator>
      <dc:date>2014-03-17T13:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple rows per one user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184008#M52994</link>
      <description>&lt;P&gt;If the lookup is on User, just add a lookup command after the stats.&lt;/P&gt;

&lt;P&gt;....| stats...by USER | lookup yourlookupfile.csv lookupField as USER OUTPUT &lt;SPECIFY your="" output="" fields=""&gt;.&lt;/SPECIFY&gt;&lt;/P&gt;

&lt;P&gt;This will just add the fields to existing output.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 13:54:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/show-multiple-rows-per-one-user/m-p/184008#M52994</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-17T13:54:22Z</dc:date>
    </item>
  </channel>
</rss>

