<?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: How to create a table with the earliest and latest event times of individual Users? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234111#M69564</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* sourcetype=*  User | eval User=lower(User) | lookup local=true lookup1.csv user_id as User | eval Name=display_name 
| stats earliest(_time) AS "First Login" latest(_time) AS "Last Login" BY Name | convert ctime("First Login") ctime("Last Login")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Jun 2016 12:56:09 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-06-29T12:56:09Z</dc:date>
    <item>
      <title>How to create a table with the earliest and latest event times of individual Users?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234110#M69563</link>
      <description>&lt;P&gt;I am trying to create a table that will show the earliest and latest event times of every user in my search. The "First Login"column will be their very first event time and the "Last Login" column will be their last event created.&lt;/P&gt;

&lt;P&gt;This search will return every event's _time for each user but the "Last Login" is the same for every User. With this search I can see the times I want but I want to dedup the Users.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=*  User | eval User=lower(User) | lookup local=true lookup1.csv user_id as User | eval Name=display_name  | table _time User Name| streamstats earliest(_time) as "First Login" latest(_time) as "Last Login" | convert ctime("First Login") ctime("Last Login")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search will return single User event's _time  but it is not finding the earliest event _time for the "First Login" and the "Last Login" is the same for every User .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index=* sourcetype=*  User | eval User=lower(User) | lookup local=true lookup1.csv user_id as User | eval Name=display_name  | table _time User Name| streamstats earliest(_time) as "First Login" latest(_time) as "Last Login" | convert ctime("First Login") ctime("Last Login") | dedup Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a better way to achieve what I am looking to do? &lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 12:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234110#M69563</guid>
      <dc:creator>Aaron_Fogarty</dc:creator>
      <dc:date>2016-06-29T12:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with the earliest and latest event times of individual Users?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234111#M69564</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* sourcetype=*  User | eval User=lower(User) | lookup local=true lookup1.csv user_id as User | eval Name=display_name 
| stats earliest(_time) AS "First Login" latest(_time) AS "Last Login" BY Name | convert ctime("First Login") ctime("Last Login")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jun 2016 12:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234111#M69564</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-29T12:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with the earliest and latest event times of individual Users?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234112#M69565</link>
      <description>&lt;P&gt;Thank a million Woodcock, that's exactly it.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 13:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-the-earliest-and-latest-event-times/m-p/234112#M69565</guid>
      <dc:creator>Aaron_Fogarty</dc:creator>
      <dc:date>2016-06-29T13:14:00Z</dc:date>
    </item>
  </channel>
</rss>

