<?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 set up search so that the events tab matches the logs corresponding to the statistics tab? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464239#M130845</link>
    <description>&lt;P&gt;I've got the following search to identify when a user has more than 20 auth failures. &lt;BR /&gt;
I'm trying to find a way to remove additional logs of users who have less than 20 auth failures from the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab.&lt;/P&gt;

&lt;P&gt;For example, I might see in the &lt;STRONG&gt;Statistics&lt;/STRONG&gt; tab 1 result indicating that a single user failed 135 times. However in the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab I see 145 logs  which include 10 additional auth failures of other users that failed less than 20 times.&lt;/P&gt;

&lt;P&gt;I only want to see 135 logs in the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab corresponding to the 135 results from "| search TotalAuthFailures &amp;gt;= 20". This is so when analysts are drilling down on the alert they're not confused by additional users in the &lt;STRONG&gt;Events&lt;/STRONG&gt; raw logs.&lt;/P&gt;

&lt;P&gt;How can I do this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype="wineventlog" EventCode=4625 (Sub_Status=0xC000006A OR Sub_Status=0xC0000064)
 | eval match=if(match(Account_Name,".*\$"),1,0)
 | eval Description=if(Sub_Status=="0xC0000064","User name does not exist.","User name is correct but the password is wrong.")
 | where  match=0 | stats  count by user,src_ip,src_nt_host,Description
 | rename  count AS "TotalAuthFailures" user AS "User (Origin)" src_ip AS "Source IP Address" src_nt_host AS "Host (Origin)" EventCode AS "Event ID"
 | dedup  "User (Origin)"
 | search TotalAuthFailures &amp;gt;= 20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 May 2020 20:54:07 GMT</pubDate>
    <dc:creator>gnoriega</dc:creator>
    <dc:date>2020-05-22T20:54:07Z</dc:date>
    <item>
      <title>How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464239#M130845</link>
      <description>&lt;P&gt;I've got the following search to identify when a user has more than 20 auth failures. &lt;BR /&gt;
I'm trying to find a way to remove additional logs of users who have less than 20 auth failures from the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab.&lt;/P&gt;

&lt;P&gt;For example, I might see in the &lt;STRONG&gt;Statistics&lt;/STRONG&gt; tab 1 result indicating that a single user failed 135 times. However in the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab I see 145 logs  which include 10 additional auth failures of other users that failed less than 20 times.&lt;/P&gt;

&lt;P&gt;I only want to see 135 logs in the &lt;STRONG&gt;Events&lt;/STRONG&gt; tab corresponding to the 135 results from "| search TotalAuthFailures &amp;gt;= 20". This is so when analysts are drilling down on the alert they're not confused by additional users in the &lt;STRONG&gt;Events&lt;/STRONG&gt; raw logs.&lt;/P&gt;

&lt;P&gt;How can I do this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype="wineventlog" EventCode=4625 (Sub_Status=0xC000006A OR Sub_Status=0xC0000064)
 | eval match=if(match(Account_Name,".*\$"),1,0)
 | eval Description=if(Sub_Status=="0xC0000064","User name does not exist.","User name is correct but the password is wrong.")
 | where  match=0 | stats  count by user,src_ip,src_nt_host,Description
 | rename  count AS "TotalAuthFailures" user AS "User (Origin)" src_ip AS "Source IP Address" src_nt_host AS "Host (Origin)" EventCode AS "Event ID"
 | dedup  "User (Origin)"
 | search TotalAuthFailures &amp;gt;= 20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 May 2020 20:54:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464239#M130845</guid>
      <dc:creator>gnoriega</dc:creator>
      <dc:date>2020-05-22T20:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464240#M130846</link>
      <description>&lt;P&gt;The results of &lt;EM&gt;verbose mode&lt;/EM&gt; and Drilldown are different, so you don't have to worry about it.&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 22:16:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464240#M130846</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-22T22:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464241#M130847</link>
      <description>&lt;P&gt;I get the same result in the search verbose mode (Events 145) and in my dashboard Drilldown (145 logs). That's how I discovered the issue. When I drilled down I saw the additional users. &lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 23:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464241#M130847</guid>
      <dc:creator>gnoriega</dc:creator>
      <dc:date>2020-05-22T23:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464242#M130848</link>
      <description>&lt;P&gt;what's drilldown query?&lt;BR /&gt;
Is there &lt;CODE&gt;where&lt;/CODE&gt; command ?&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 23:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464242#M130848</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-22T23:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464243#M130849</link>
      <description>&lt;P&gt;In my dashboard I have 2 drilldown panels, the first displays the statistics table with the correct number of auth failures (135). The second drilldown panel in the dashboard shows the events (145). It's in this second panel where I would only like to see the 135 event.&lt;/P&gt;

&lt;P&gt;Here's the code for the panels in my dashboard: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;[Drilldown] Recent statistics for $selected_value$ at $converted_time$&amp;lt;/title&amp;gt;
        &amp;lt;search id="base"&amp;gt;
          &amp;lt;query&amp;gt;$field_token$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$selected_value_earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$selected_value_latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
   &amp;lt;panel&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;title&amp;gt;[Drilldown] Recent events for $selected_value$ at $converted_time$&amp;lt;/title&amp;gt;
        &amp;lt;search base="base"&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/event&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 May 2020 14:50:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464243#M130849</guid>
      <dc:creator>gnoriega</dc:creator>
      <dc:date>2020-05-25T14:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464244#M130850</link>
      <description>&lt;P&gt;First, deduping there is giving you invalid results. If there ARE any duplicate users, then you need to either retain them, or sort descending on count before deduping.  (Also, as best practices, it's better to do those things before making the names "pretty".)&lt;/P&gt;

&lt;P&gt;Make this your base&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search id="base"&amp;gt;
    &amp;lt;query&amp;gt;
     index=main sourcetype="wineventlog" EventCode=4625 (Sub_Status=0xC000006A OR Sub_Status=0xC0000064)
      | eval match=if(match(Account_Name,".*\$"),1,0)
      | eval Description=if(Sub_Status=="0xC0000064","User name does not exist.","User name is correct but the password is wrong.")
      | where  match=0 
      | fields user, src_ip, src_nt_host, Description
    &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Make this your second query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search base="base"&amp;gt;
   &amp;lt;query&amp;gt;
   | stats  count AS "TotalAuthFailures" by user, src_ip, src_nt_host, Description
   | search TotalAuthFailures &amp;gt;= 20

   | sort 0 - TotalAuthFailures + user
   | rename COMMENT as "dedup user here if you really need to"

   | rename  
     user AS "User (Origin)", 
     src_ip AS "Source IP Address", 
     src_nt_host AS "Host (Origin)", 
     EventCode AS "Event ID"
   &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Make this your third query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search base="base"&amp;gt;
   &amp;lt;query&amp;gt;
   | eventstats  count AS "TotalAuthFailures" by user, src_ip, src_nt_host, Description
   | search TotalAuthFailures &amp;gt;= 20
   | fields - TotalAuthFailures 
   &amp;lt;/query&amp;gt;
 &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 May 2020 17:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464244#M130850</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-05-26T17:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up search so that the events tab matches the logs corresponding to the statistics tab?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464245#M130851</link>
      <description>&lt;P&gt;Hi @DalJeanis &lt;/P&gt;

&lt;P&gt;why do you use eventstats in the 3 query as opposed to stats like the 2nd query ?&lt;/P&gt;

&lt;P&gt;thx&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 13:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-up-search-so-that-the-events-tab-matches-the-logs/m-p/464245#M130851</guid>
      <dc:creator>Skins</dc:creator>
      <dc:date>2020-05-28T13:44:58Z</dc:date>
    </item>
  </channel>
</rss>

