<?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: Searching for active, inactive users. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/572802#M199635</link>
    <description>&lt;P&gt;Hey sorry for the slow respond, other things came up. Just got back to this, and it just might work.&lt;BR /&gt;&lt;BR /&gt;Which server do you put this collections.conf and transforms.conf on? Search head, indexer, or deploy/license server? This is on multiple indexes like index="*-windows"&lt;BR /&gt;Is it on the search head? \program files\splunk\etc\apps\search\local\ ?&lt;BR /&gt;&lt;BR /&gt;Also, does the timepicker on the first search need to be 90 days?&lt;BR /&gt;&lt;BR /&gt;Also, does this just give me a list of active and inactive users, or does it give me an alert if a user goes from inactive -&amp;gt; active?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 09:25:19 GMT</pubDate>
    <dc:creator>michaelnorup</dc:creator>
    <dc:date>2021-10-28T09:25:19Z</dc:date>
    <item>
      <title>Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563907#M196430</link>
      <description>&lt;P&gt;Hey.&lt;BR /&gt;&lt;BR /&gt;Im trying to create a search that lists users that have for example more than 90 days between the last 2 logons.&lt;BR /&gt;&lt;BR /&gt;I have tried getting the last log on time with this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="index" sourcetype="wineventlog:security" EventCode=4624 | stats max(_time) by user&lt;/LI-CODE&gt;&lt;P&gt;But that doesnt really work for me.&lt;BR /&gt;Not sure how i proceed from here however&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 09:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563907#M196430</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-08-19T09:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563920#M196432</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;&lt;P&gt;index=_audit sourcetype=audittrail CASE(action=login attempt) CASE(info=succeeded) earliest=-90d&lt;BR /&gt;| stats count by user&lt;BR /&gt;| where count=1&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 10:37:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563920#M196432</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-08-19T10:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563925#M196434</link>
      <description>&lt;P&gt;Hey. Unfortunately it is a different index than the _audit one i need to work on. I edited the original message, maybe after you saw it the first time, so the fields you are using dont all exist&lt;BR /&gt;&lt;BR /&gt;It is a windows index if the eventcode didnt give that away&lt;BR /&gt;&lt;BR /&gt;Thanks though&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 09:56:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563925#M196434</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-08-19T09:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563933#M196437</link>
      <description>&lt;P&gt;Same approach:&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;index=windows source=WinEventLog:Security EventCode=4624 earliest=-90d&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;| stats count by user&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;| where count=1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 11:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563933#M196437</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-11-08T11:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563934#M196438</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;&lt;BR /&gt;Doesnt this only find users who are inactive?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 11:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563934#M196438</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-08-19T11:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563935#M196439</link>
      <description>&lt;P&gt;True. Let’s expand the solution, then:&lt;/P&gt;&lt;P&gt;Instead of the “| where count=1”, you could do something like ‘| eval status=if(count&amp;gt;1, “active”,”inactive”)’&lt;/P&gt;&lt;P&gt;This, however, doesn’t completely address the issue. To get the fullest solution, you could create a lookup with columns “user” and “last_login”. Regular searches would update the lookup with the latest login time found. Then, your search would be against the lookup where “now()-last_login” &amp;gt; 90 days.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 11:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563935#M196439</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-08-19T11:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563942#M196442</link>
      <description>&lt;P&gt;You might be right, but im not sure how to do this correctly&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 11:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563942#M196442</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-08-19T11:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563948#M196444</link>
      <description>&lt;P&gt;Please let me know if this works for you. You'd run the first search ("index=windows ...") as a scheduled search on a regular frequency (for example, every hour or every day) looking back over a slightly longer period of time. If you ran it daily, you might set the time picker to 2 days or, if every hour, to 2 hours. It will always grab the latest login, so overlap into previous searches will not give you wrong information.&lt;/P&gt;&lt;P&gt;The settings in collections.conf and transforms.conf set up a kvstore collection named "last_login". You could make the same sort of lookup through Lookup Editor if you didn't have CLI access.&lt;/P&gt;&lt;P&gt;Finally, the second search ("|inputlookup last_login ...") is the one to run to get your report of active and inactive users.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;collections.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[last_login]
accelerated_fields.userhash = {"user":1}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[last_login]
collection = last_login
external_type = kvstore
fields_list = _key,user,last_login,hash
match_type = WILDCARD(user)&lt;/LI-CODE&gt;&lt;P&gt;Search to schedule regularly to populate the "last_login" lookup:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=windows source=WinEventLog:Security eventCode=4624
| stats latest(_time) as last_login by user
| eval hash=md5(user) 
| lookup last_login hash OUTPUTNEW _key as _key
| fields user,last_login,hash,_key
| outputlookup last_login append=t&lt;/LI-CODE&gt;&lt;P&gt;Search to run to get a listing of active and inactive users:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup last_login
| eval status = if(last_login &amp;lt; relative_time(now(),"-90d"),"inactive","active")
| convert ctime (last_login)
| table user last_login status&lt;/LI-CODE&gt;&lt;P&gt;That's it! If it works for you, please mark it as the solution to your question.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 12:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/563948#M196444</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-08-19T12:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/572802#M199635</link>
      <description>&lt;P&gt;Hey sorry for the slow respond, other things came up. Just got back to this, and it just might work.&lt;BR /&gt;&lt;BR /&gt;Which server do you put this collections.conf and transforms.conf on? Search head, indexer, or deploy/license server? This is on multiple indexes like index="*-windows"&lt;BR /&gt;Is it on the search head? \program files\splunk\etc\apps\search\local\ ?&lt;BR /&gt;&lt;BR /&gt;Also, does the timepicker on the first search need to be 90 days?&lt;BR /&gt;&lt;BR /&gt;Also, does this just give me a list of active and inactive users, or does it give me an alert if a user goes from inactive -&amp;gt; active?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 09:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/572802#M199635</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-10-28T09:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573602#M199890</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/152762"&gt;@jwalthour&lt;/a&gt;&amp;nbsp;Hi JWalthour. Can you still assist me with this? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 09:39:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573602#M199890</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-11-04T09:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573610#M199894</link>
      <description>&lt;P&gt;Hey, Michael!&lt;/P&gt;&lt;P&gt;All of this goes on the search head. The first search the lookup you would run “frequently,” that could be hourly, daily, whatever frequency you need. The time picker should overlap the last time you ran the search so as not to miss anything. The lookup just gives you when a user’s last login is. The last search determines “active” vs “inactive”, which I set to be 90 days—if you’ve not seen a user login in 90 days, consider them inactive.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 11:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573610#M199894</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-11-04T11:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573612#M199896</link>
      <description>&lt;P&gt;Okay cool thanks. I have added the collections.conf and transforms.conf to the searchhead.&amp;nbsp;&lt;BR /&gt;I have scheduled the first search as a report that runs every day, with a time picker of 2 days&lt;BR /&gt;&lt;BR /&gt;Both the first and the last search gives me 0 results however.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573612#M199896</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-11-04T14:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573970#M200025</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/152762"&gt;@jwalthour&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fixed the first search with a capital E in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EventCode&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we just have to edit the second search to not only show the status of the users, but show if changes are made &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If you edit that i will mark your answer as correct&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 07:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573970#M200025</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-11-08T07:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573995#M200031</link>
      <description>&lt;P&gt;What do you mean “show if changes are made”?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 11:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573995#M200031</guid>
      <dc:creator>jwalthour</dc:creator>
      <dc:date>2021-11-08T11:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Searching for active, inactive users.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573998#M200033</link>
      <description>&lt;P&gt;The last search just shows a list of users with a active/inactive field right?&lt;BR /&gt;&lt;BR /&gt;What i am looking for is if a user goes from inactive -&amp;gt; active&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 11:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-for-active-inactive-users/m-p/573998#M200033</guid>
      <dc:creator>michaelnorup</dc:creator>
      <dc:date>2021-11-08T11:59:41Z</dc:date>
    </item>
  </channel>
</rss>

