<?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 do you search users who were not logged in the past 30 days? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/540224#M152810</link>
    <description>&lt;P&gt;Please check below query guys the best result i have got,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| `inactive_accounts(30)` | eval LastTime=strftime(lastTime,"%Y-%m-%d %H:%M:%S.%Q") | sort -_time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;happy splunking!!!&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2021 10:36:54 GMT</pubDate>
    <dc:creator>chandan</dc:creator>
    <dc:date>2021-02-17T10:36:54Z</dc:date>
    <item>
      <title>How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444713#M126120</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to search for a list of users who have not logged into the Splunk environment in the past 30 days.&lt;/P&gt;

&lt;P&gt;Can you please look into the below query and let me know what is not correct in that?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_access | eval length=len(user) | search length&amp;gt;1 | eval Time=strptime(_time,"%Y-%m-%d") | eval Before30days=relative_time(now(),"-30d@d") |where Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Feb 2019 16:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444713#M126120</guid>
      <dc:creator>ruchijain</dc:creator>
      <dc:date>2019-02-04T16:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444714#M126121</link>
      <description>&lt;P&gt;Here is one way to do it using the audit log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit splunk_server=local action=search user=* 
| stats latest(_time) as last_search by user 
| append 
    [| rest /services/authentication/users 
    | eval user = title 
    | fields user ] 
| stats last(*) as *
| eval days_since_last_search = round((time() - last_search) / 86400,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should check how far back your audit log goes. &lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 18:30:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444714#M126121</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-04T18:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444715#M126122</link>
      <description>&lt;P&gt;This shows only one record with user as "testuser" which is not correct there are many users who have not logged in to the Splunk environment.&lt;BR /&gt;
Can you please let me know what else can be used.&lt;BR /&gt;
Or if you can let me know how we can check when each user last logged in with the help of that also we can find who all cannot logged in from past 30 days&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 09:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444715#M126122</guid>
      <dc:creator>ruchijain</dc:creator>
      <dc:date>2019-02-05T09:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444716#M126123</link>
      <description>&lt;P&gt;It only shows one result can you please check and let know. &lt;BR /&gt;
Or if you cant let know how we can check last when each user login so that this will also provide the details to me.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 09:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444716#M126123</guid>
      <dc:creator>ruchijain</dc:creator>
      <dc:date>2019-02-05T09:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444717#M126124</link>
      <description>&lt;P&gt;hi @ruchijain &lt;/P&gt;

&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access user!="-"    
 | stats earliest(_time) AS StartTime latest(_time) AS EndTime count by user date_mday    
 | join type=left user         [        
      | rest /services/authentication/users                
      | rex field=id "https:\/\/127.0.0.1:8089\/(\w+\/)+(?&amp;lt;user&amp;gt;\w+)"                
      | rename realname AS Name               
      | fields user 
       ]    
 | search user=*    
 | eval         
      Duration=tostring(EndTime-StartTime,"Duration"),        
      StartTime=strftime(StartTime,"%d/%m/%Y %H.%M.%S"),        
      EndTime=strftime(EndTime,"%d/%m/%Y %H.%M.%S")    
 | sort user
 | table user StartTime EndTime Duration | dedup user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 10:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444717#M126124</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2019-02-05T10:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444718#M126125</link>
      <description>&lt;P&gt;Thanks it gives the whole list....&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 11:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/444718#M126125</guid>
      <dc:creator>ruchijain</dc:creator>
      <dc:date>2019-02-05T11:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you search users who were not logged in the past 30 days?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/540224#M152810</link>
      <description>&lt;P&gt;Please check below query guys the best result i have got,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| `inactive_accounts(30)` | eval LastTime=strftime(lastTime,"%Y-%m-%d %H:%M:%S.%Q") | sort -_time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;happy splunking!!!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 10:36:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-search-users-who-were-not-logged-in-the-past-30-days/m-p/540224#M152810</guid>
      <dc:creator>chandan</dc:creator>
      <dc:date>2021-02-17T10:36:54Z</dc:date>
    </item>
  </channel>
</rss>

