<?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 add a count to a table using the table command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291610#M88077</link>
    <description>&lt;P&gt;How do I add a count to a table using the table command?  The project I'm working on requires that a table is mad showing the day of the week, followed by a list of the users who logged on that day and how many time the logged on.  The output looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;=============================================
Wednesday          |                                  user1         |     5
                   |                                  user2         |     3
                   |                                  user3         |     4
                   |                                  user4         |     3
=============================================
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm currently using this search to get some of what I need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* date=* user=* | transaction date | table date user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I can't get the count I need at the end.  I tried appending a stats count:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* date=* user=* | transaction date | table date user | appendcols [search user=* | stats count by user]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But had no luck.  Is there anyway to do this?&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2017 18:22:37 GMT</pubDate>
    <dc:creator>Svill321</dc:creator>
    <dc:date>2017-07-06T18:22:37Z</dc:date>
    <item>
      <title>How do I add a count to a table using the table command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291610#M88077</link>
      <description>&lt;P&gt;How do I add a count to a table using the table command?  The project I'm working on requires that a table is mad showing the day of the week, followed by a list of the users who logged on that day and how many time the logged on.  The output looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;=============================================
Wednesday          |                                  user1         |     5
                   |                                  user2         |     3
                   |                                  user3         |     4
                   |                                  user4         |     3
=============================================
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm currently using this search to get some of what I need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* date=* user=* | transaction date | table date user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I can't get the count I need at the end.  I tried appending a stats count:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* date=* user=* | transaction date | table date user | appendcols [search user=* | stats count by user]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But had no luck.  Is there anyway to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291610#M88077</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2017-07-06T18:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a count to a table using the table command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291611#M88078</link>
      <description>&lt;P&gt;... | addcoltotals labelfield=change_name label=count&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291611#M88078</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-07-06T18:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a count to a table using the table command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291612#M88079</link>
      <description>&lt;P&gt;I would do like this (totally avoiding transaction command), will give the output in expected format.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* date=* user=* | stats count by date user | stats list(user) as user list(count) as count by date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291612#M88079</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-06T19:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a count to a table using the table command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291613#M88080</link>
      <description>&lt;P&gt;You, my friend, are a saint! This works perfectly. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 20:31:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-a-count-to-a-table-using-the-table-command/m-p/291613#M88080</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2017-07-06T20:31:38Z</dc:date>
    </item>
  </channel>
</rss>

