<?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 How to check 10 days prior to an event in Splunk for a failed login attempt? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-10-days-prior-to-an-event-in-Splunk-for-a-failed/m-p/634914#M220567</link>
    <description>&lt;P&gt;I have a search in Splunk that returns events for failed logins. I want to be able to check for a successful authentication from a user and an IP 10 days prior to the failed login. Is this possible via a query?&lt;/P&gt;&lt;P&gt;index=logins&lt;BR /&gt;| where AuthenticationResults="failed"&lt;BR /&gt;| sort 0 - _time&lt;BR /&gt;| eval successtime = if(AuthenticationResult=="success", _time, null())&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 14:09:45 GMT</pubDate>
    <dc:creator>MM0071</dc:creator>
    <dc:date>2023-03-17T14:09:45Z</dc:date>
    <item>
      <title>How to check 10 days prior to an event in Splunk for a failed login attempt?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-10-days-prior-to-an-event-in-Splunk-for-a-failed/m-p/634914#M220567</link>
      <description>&lt;P&gt;I have a search in Splunk that returns events for failed logins. I want to be able to check for a successful authentication from a user and an IP 10 days prior to the failed login. Is this possible via a query?&lt;/P&gt;&lt;P&gt;index=logins&lt;BR /&gt;| where AuthenticationResults="failed"&lt;BR /&gt;| sort 0 - _time&lt;BR /&gt;| eval successtime = if(AuthenticationResult=="success", _time, null())&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 14:09:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-10-days-prior-to-an-event-in-Splunk-for-a-failed/m-p/634914#M220567</guid>
      <dc:creator>MM0071</dc:creator>
      <dc:date>2023-03-17T14:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to check 10 days prior to an event in Splunk for a failed login attempt?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-10-days-prior-to-an-event-in-Splunk-for-a-failed/m-p/634941#M220573</link>
      <description>&lt;P&gt;OK. So there are some things that can be fixed in the first place.&lt;/P&gt;&lt;P&gt;1. Don't do&lt;/P&gt;&lt;PRE&gt;index=logins&lt;BR /&gt;| where AuthenticationResults="failed"&lt;/PRE&gt;&lt;P&gt;just do&lt;/P&gt;&lt;PRE&gt;index=logins AuthenticationResults="failed"&lt;/PRE&gt;&lt;P&gt;With one very small caveat that there are some situations when the field is parsed out from a longer string so that it's not broken as indexed term. But generally it's much better to do it like that.&lt;/P&gt;&lt;P&gt;But in your case since you want all types of results, that condition is not needed anyway.&lt;/P&gt;&lt;P&gt;2. Reverse sorting by _time is completely unneeded since Splunk by default returns data this way.&lt;/P&gt;&lt;P&gt;3. OK. So you want to find all logins, regardless of their state&lt;/P&gt;&lt;PRE&gt;index=logins (and any further conditions that can narrow your results to&lt;BR /&gt;just logins in case you have other data in that index)&lt;/PRE&gt;&lt;P&gt;Then you want to find the times of failed logins. First create an additional field which will exist only for those failed logins&lt;/P&gt;&lt;PRE&gt;| eval failedlogintime=if(AuthenticationResult=="failed",_time,null())&lt;/PRE&gt;&lt;P&gt;Then for each event find when was the latest failed login&lt;/P&gt;&lt;PRE&gt;| streamstats latest(failedlogintime) as failedlogintime by user IP&lt;/PRE&gt;&lt;P&gt;Now you can only filter out those which are longer than 10 days before failed login&lt;/P&gt;&lt;PRE&gt;| where failedlogintime-_time&amp;lt;=864000&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 15:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-10-days-prior-to-an-event-in-Splunk-for-a-failed/m-p/634941#M220573</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-17T15:36:16Z</dc:date>
    </item>
  </channel>
</rss>

