<?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 Evaluate search based on one index in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Evaluate-search-based-on-one-index/m-p/658795#M111411</link>
    <description>&lt;P&gt;I would like help with creating the following.&lt;/P&gt;&lt;P&gt;Search when account was created and return a list of users who have not authenticated 30 days after account was created.&lt;/P&gt;&lt;P&gt;I have a search to show details for a particular user, but I would like to create a list of all users and set an alert if not authenticated after 30 days.&lt;/P&gt;&lt;P&gt;index=duo&lt;/P&gt;&lt;P&gt;object=&amp;lt;user1&amp;gt; OR username=&amp;lt;user1&amp;gt;&lt;/P&gt;&lt;P&gt;| eval _time=strftime(_time,"%a, %m/%d/%Y %H:%M")&lt;/P&gt;&lt;P&gt;| table _time, object, factor, action, actionlabel, new_enrollment, username | rename object AS "Modified User", username AS "Actioned By" | sort _time desc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if actionlabel="&lt;SPAN&gt;added user'&amp;nbsp;&lt;/SPAN&gt;exists, I would like to return new_enrollment=false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object(actionlabel=added user) = username(new_enrollment=false)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how the output I'm searching for&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;User&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Created&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Authentications since created (After 31 days)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Last Authentication&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;user1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7/25/2023&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;user2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7/27/2023&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8/19/2023&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 26 Sep 2023 19:38:46 GMT</pubDate>
    <dc:creator>KDWilk</dc:creator>
    <dc:date>2023-09-26T19:38:46Z</dc:date>
    <item>
      <title>Evaluate search based on one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Evaluate-search-based-on-one-index/m-p/658795#M111411</link>
      <description>&lt;P&gt;I would like help with creating the following.&lt;/P&gt;&lt;P&gt;Search when account was created and return a list of users who have not authenticated 30 days after account was created.&lt;/P&gt;&lt;P&gt;I have a search to show details for a particular user, but I would like to create a list of all users and set an alert if not authenticated after 30 days.&lt;/P&gt;&lt;P&gt;index=duo&lt;/P&gt;&lt;P&gt;object=&amp;lt;user1&amp;gt; OR username=&amp;lt;user1&amp;gt;&lt;/P&gt;&lt;P&gt;| eval _time=strftime(_time,"%a, %m/%d/%Y %H:%M")&lt;/P&gt;&lt;P&gt;| table _time, object, factor, action, actionlabel, new_enrollment, username | rename object AS "Modified User", username AS "Actioned By" | sort _time desc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if actionlabel="&lt;SPAN&gt;added user'&amp;nbsp;&lt;/SPAN&gt;exists, I would like to return new_enrollment=false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Object(actionlabel=added user) = username(new_enrollment=false)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how the output I'm searching for&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;User&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Created&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Authentications since created (After 31 days)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Last Authentication&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;user1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7/25/2023&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;user2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7/27/2023&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8/19/2023&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Sep 2023 19:38:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Evaluate-search-based-on-one-index/m-p/658795#M111411</guid>
      <dc:creator>KDWilk</dc:creator>
      <dc:date>2023-09-26T19:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate search based on one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Evaluate-search-based-on-one-index/m-p/658810#M111414</link>
      <description>&lt;P&gt;Your table shows user2 that authenticated less than 30 days after creation, so do you want this in the output? What does "&lt;SPAN&gt;Authentications since created (After 31 days)" in your table as user2 has a positive value, but the last date within 30 days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you're looking to find users who were created 31 days ago, but have not logged in since, then you would use this type of search, where you need to work out what is a login event and what is a created event so you can determine the logic for event_is_login in the examplke below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=duo earliest=-31d@d latest=@d INCLUDE_CREATED_EVENTS_AND_LOGIN_EVENTS
| eval created=if(actionlabel="added user" AND _time &amp;lt; relative_time(now(), "-3d@d"), _time, 0)
| where created=1 OR event_is_login
| stats count(eval(if(event_is_login), 1, null()))) as Logins 
        max(eval(if(event_is_login), _time, null()))) as LastLogin
        max(created) as created_time
        by object
| rename object AS User
| eval LastLogin=strftime(LastLogin, "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What state in your data indicates that the user was created, is it actionlable="added user"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 04:04:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Evaluate-search-based-on-one-index/m-p/658810#M111414</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-09-27T04:04:03Z</dc:date>
    </item>
  </channel>
</rss>

