<?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: Find lastest access data for a list of users in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380721#M111406</link>
    <description>&lt;P&gt;Thanks for that David. The initial subsearch with a lookup was causing a big overhead for some reason but if I turn that into a normal lookup:&lt;/P&gt;

&lt;P&gt;| lookup Users samAccountName AS sourceUserName OUTPUT Type AS Type &lt;/P&gt;

&lt;P&gt;Then use your append on the bottom of it it runs a lot faster.&lt;/P&gt;

&lt;P&gt;Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2019 15:17:52 GMT</pubDate>
    <dc:creator>alucarddjin</dc:creator>
    <dc:date>2019-07-08T15:17:52Z</dc:date>
    <item>
      <title>Find lastest access data for a list of users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380718#M111403</link>
      <description>&lt;P&gt;I have a lookup list of users and I want to get that date off their last event (or empty if no event) but I keep getting an  various errors. So far I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Users.csv 
    [ search sourcetype=DataSource event="GRANTED" 
    | stats max(_time) AS lastUsed by Username
    | rename Username AS samAccountName ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I get my lookup list of users, start the subsearch pull back a list of usernames and last event times then rename the user name to match the column in my lookup list.&lt;/P&gt;

&lt;P&gt;My first assumption on this is that maybe you can't use the subsearch in a lookup so if this is wrong how can find the last time of each user on the list even if there is no match?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380718#M111403</guid>
      <dc:creator>alucarddjin</dc:creator>
      <dc:date>2019-07-08T14:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Find lastest access data for a list of users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380719#M111404</link>
      <description>&lt;P&gt;Hi @alucarddjin,&lt;/P&gt;

&lt;P&gt;You could do it like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search sourcetype=DataSource event="GRANTED"  [| inputlookup Users.csv | rename samAccountName AS Username]
 | stats max(_time) AS lastUsed by Username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It should give you the list of users and their last time.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380719#M111404</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-07-08T14:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Find lastest access data for a list of users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380720#M111405</link>
      <description>&lt;P&gt;You can also keep the values that are int he CSV but not in the logs by doing the following :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  search sourcetype=DataSource event="GRANTED"  [| inputlookup Users.csv | rename samAccountName AS Username]
  | stats max(_time) AS lastUsed by Username
  | append [| inputlookup Users.csv| rename samAccountName AS Username| eval lastUsed=0  ]
  | stats max(lastUsed) AS lastUsed by Username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380720#M111405</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-07-08T14:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Find lastest access data for a list of users</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380721#M111406</link>
      <description>&lt;P&gt;Thanks for that David. The initial subsearch with a lookup was causing a big overhead for some reason but if I turn that into a normal lookup:&lt;/P&gt;

&lt;P&gt;| lookup Users samAccountName AS sourceUserName OUTPUT Type AS Type &lt;/P&gt;

&lt;P&gt;Then use your append on the bottom of it it runs a lot faster.&lt;/P&gt;

&lt;P&gt;Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:17:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-lastest-access-data-for-a-list-of-users/m-p/380721#M111406</guid>
      <dc:creator>alucarddjin</dc:creator>
      <dc:date>2019-07-08T15:17:52Z</dc:date>
    </item>
  </channel>
</rss>

