<?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: Create a search for Hosts that failed Authentication this week but were Successful Last. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641663#M222274</link>
    <description>&lt;P&gt;HI, this seems like it could work but I need to do this for over 8k IPs. Is there a way to do this without having to specify each one?&lt;/P&gt;</description>
    <pubDate>Thu, 27 Apr 2023 19:32:58 GMT</pubDate>
    <dc:creator>atebysandwich</dc:creator>
    <dc:date>2023-04-27T19:32:58Z</dc:date>
    <item>
      <title>How to create a search for Hosts that failed Authentication this week but were successful last?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641660#M222271</link>
      <description>&lt;P&gt;I have a table that has the following fields:&lt;/P&gt;
&lt;P&gt;IP&lt;BR /&gt;&lt;SPAN&gt;Host_Auth&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;_time&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The _time field shows the time the host was authenticated against for the current week and the previous.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;How can I compare the Host_Auth field from the last two results for the same host? If the value for Host_Auth for a particular IP was successful last week by not this week, how can I show that?&lt;BR /&gt;&lt;BR /&gt;Eample&lt;BR /&gt;&lt;BR /&gt;IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Host_Auth&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_time&amp;nbsp;&lt;BR /&gt;1.1.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Unix Successful&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2023-04-23 00:00:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;1.1.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unix Successful&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;2023-04-16 00:00:00&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.2.2.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unix Failed&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2023-04-23 00:00:00&amp;nbsp;&lt;BR /&gt;2.2.2.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Unix Successful&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;2023-04-16 00:00:00&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 13:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641660#M222271</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-28T13:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641661#M222272</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253260"&gt;@atebysandwich&lt;/a&gt;, counting the unique values in Host_Auth by IP and checking the last state may be sufficient:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="
IP,Host_Auth,_time 
1.1.1.1,Unix Successful,2023-04-23 00:00:00          
1.1.1.1,Unix Successful,2023-04-16 00:00:00
2.2.2.2,Unix Failed,2023-04-23 00:00:00 
2.2.2.2,Unix Successful,2023-04-16 00:00:00 
3.3.3.3,Unix Successful,2023-04-23 00:00:00 
3.3.3.3,Unix Failed,2023-04-16 00:00:00 
4.4.4.4,Unix Failed,2023-04-16 00:00:00 
4.4.4.4,Unix Failed,2023-04-23 00:00:00
"
| stats dc(Host_Auth) as unique_count, last(Host_Auth) as last_auth by IP
| where unique_count&amp;gt;1 AND last_auth="Unix Failed"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've added two more scenarios, so:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Success &amp;gt; Success (no result)&lt;/LI&gt;&lt;LI&gt;Fail &amp;gt; Success (no result)&lt;/LI&gt;&lt;LI&gt;Success &amp;gt; Fail (result)&lt;/LI&gt;&lt;LI&gt;Fail &amp;gt; Fail (no result)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is this what you're looking for?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 19:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641661#M222272</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-27T19:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641663#M222274</link>
      <description>&lt;P&gt;HI, this seems like it could work but I need to do this for over 8k IPs. Is there a way to do this without having to specify each one?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 19:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641663#M222274</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-27T19:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641667#M222277</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I added the makeresults command to generate my testdata, you should replace that line with your own search.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 19:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641667#M222277</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-27T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641673#M222278</link>
      <description>&lt;P&gt;I'm sorry but I don't quite understand. There is about 20 lines before the example fields I provided in my question. Do i put the makeresults before that?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 21:01:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641673#M222278</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-27T21:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641677#M222280</link>
      <description>&lt;P&gt;Sorry for the confusion. You can ignore the makeresults command, I use it in my example to simulate the example data you provided. So it would look something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;.. your original search, containing the fields _time, Host_Auth and IP ..
| stats dc(Host_Auth) as unique_count, last(Host_Auth) as last_auth by IP
| where unique_count&amp;gt;1 AND last_auth="Unix Failed"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 21:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641677#M222280</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-27T21:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641753#M222308</link>
      <description>&lt;P&gt;I got results but it doesn't seem to be accurate. For example, an IP showed up that was successful this week but not last week. What I'm looking for is the exact opposite.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 13:11:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641753#M222308</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-28T13:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641762#M222310</link>
      <description>&lt;P&gt;Weird. The only reason I can think of why this wouldn't work is sorting. Have you tried sorting your results descending before applying the rest?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort -_time
| stats dc(Host_Auth) as unique_count, last(Host_Auth) as last_auth by IP
| where unique_count&amp;gt;1 AND last_auth="Unix Failed"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The last function used in the stats command takes the last known value by IP, so if your results aren't sorted correctly that could mess things up.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 13:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641762#M222310</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-28T13:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create a search for Hosts that failed Authentication this week but were Successful Last.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641766#M222311</link>
      <description>&lt;P&gt;That didn't quite work either. There was only 1 result but over 1k of the 8k scanned failed this past week.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 14:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-Hosts-that-failed-Authentication-this/m-p/641766#M222311</guid>
      <dc:creator>atebysandwich</dc:creator>
      <dc:date>2023-04-28T14:27:51Z</dc:date>
    </item>
  </channel>
</rss>

