<?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 Add a new count field to a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100820#M26026</link>
    <description>&lt;P&gt;I have a log file of logins to a system by username.  I can product a report of the logins by time&lt;/P&gt;

&lt;P&gt;host="daily" | table Username, "First Name", "Last Name", Company, Time | sort Username&lt;/P&gt;

&lt;P&gt;but I also want to add a total of logins per Username, but I can't figure out how.  Other options for the report would be to show a list of login times per username, including fist/last name, company and then a total for that user.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2013 04:48:26 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2013-10-16T04:48:26Z</dc:date>
    <item>
      <title>Add a new count field to a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100820#M26026</link>
      <description>&lt;P&gt;I have a log file of logins to a system by username.  I can product a report of the logins by time&lt;/P&gt;

&lt;P&gt;host="daily" | table Username, "First Name", "Last Name", Company, Time | sort Username&lt;/P&gt;

&lt;P&gt;but I also want to add a total of logins per Username, but I can't figure out how.  Other options for the report would be to show a list of login times per username, including fist/last name, company and then a total for that user.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 04:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100820#M26026</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2013-10-16T04:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new count field to a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100821#M26027</link>
      <description>&lt;P&gt;You'll want to use &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="daily" | stats count by Username,"First Name","Last Name",Company,Time | sort Username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Stats supports calculating all kinds of other statistics too (as you would guess from the command name), see: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 06:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100821#M26027</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-10-16T06:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new count field to a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100822#M26028</link>
      <description>&lt;P&gt;That's great, but is there any way I can exclude Time from the difference counter, as I want per user, but I still want to show the time in the report.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 07:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100822#M26028</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2013-10-16T07:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new count field to a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100823#M26029</link>
      <description>&lt;P&gt;What time you want, the first, the last, all of them ?&lt;BR /&gt;
Here are they all,&lt;BR /&gt;
( first means the earliest, last, the oldest. )&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host="daily" | stats count values(Time) AS "all logins" first(Time) AS "most recent" last(Time) 'oldest" by Username,"First Name","Last Name",Company| sort Username&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 16:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-a-new-count-field-to-a-table/m-p/100823#M26029</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-10-16T16:44:59Z</dc:date>
    </item>
  </channel>
</rss>

