<?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: Counting &amp; Grouping Field Values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322139#M159974</link>
    <description>&lt;P&gt;Much appreciated @woodcock!  Thank you for taking the time to help me out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2017 07:11:25 GMT</pubDate>
    <dc:creator>MikeElliott</dc:creator>
    <dc:date>2017-07-24T07:11:25Z</dc:date>
    <item>
      <title>Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322133#M159968</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am currently attempting to write a Splunk search that will count the amount of failed authentications for a multiple user accounts, grouped by Source IP.  I have provided my current (basic) search string below and have attached an image of sanitised search results, detailing current output vs the output I would like to achieve.&lt;/P&gt;

&lt;P&gt;I have attempted various different combinations of stats count() and stats values(), but just cannot seem to get it right.&lt;/P&gt;

&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Windows sourcetype=WinEventLog:Security EventCode=4625
| eval Account_Name=mvindex(Account_Name, 1)
| stats count(EventCode) as Authentication_Failures by Account_Name, Source_Network_Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Uploaded Image"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3239i639202010190FFD9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Uploaded Image" alt="Uploaded Image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2017 08:49:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322133#M159968</guid>
      <dc:creator>MikeElliott</dc:creator>
      <dc:date>2017-07-21T08:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322134#M159969</link>
      <description>&lt;P&gt;@MikeElliott try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=Windows sourcetype=WinEventLog:Security EventCode=4625
 | eval Account_Name=mvindex(Account_Name, 1)
 | stats list(EventCode) as Authentication_Failures list(Source_Network_Address) as Source_Network_Address by Account_Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 12:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322134#M159969</guid>
      <dc:creator>Grumpalot</dc:creator>
      <dc:date>2017-07-21T12:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322135#M159970</link>
      <description>&lt;P&gt;I was using a csv with the generated data so you can sum Authentication_Failures if your totaling the actual times failed login also&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Windows sourcetype=WinEventLog:Security EventCode=4625
| eval Account_Name=mvindex(Account_Name, 1)
| stats sum(EventCode) as Authentication_Failures list(Source_Network_Address) as Source_Network_Address by Account_Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 12:39:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322135#M159970</guid>
      <dc:creator>Grumpalot</dc:creator>
      <dc:date>2017-07-21T12:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322136#M159971</link>
      <description>&lt;P&gt;A superb solution, my thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/35104"&gt;@Grumpalot&lt;/a&gt;.&lt;/P&gt;

&lt;P&gt;I have made a few modifications to the search string - Mainly just to adjust the end output.  I was wondering if I could be so bold as to ask for help with one last thing?&lt;/P&gt;

&lt;P&gt;How would I modify the below search string to &lt;STRONG&gt;only&lt;/STRONG&gt; provide results where Source_Network_Address field has &amp;gt;= 2 Values?  I have attempted to use a where statement, as well as a separate count() | where statement and can't seem to get it to work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Windows sourcetype=WinEventLog:Security EventCode=4625 earliest=-25h@h latest=-1h@h 
| eval Account_Name=mvindex(Account_Name, 1) 
| search Source_Network_Address!="-" 
| stats count(EventCode) as Authentication_Failures values(Source_Network_Address) as Source_Network_Address by Account_Name 
| where Authentication_Failures &amp;gt; 10 
| sort -Authentication_Failures
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322136#M159971</guid>
      <dc:creator>MikeElliott</dc:creator>
      <dc:date>2020-09-29T14:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322137#M159972</link>
      <description>&lt;P&gt;Go ahead and change your where to search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Windows sourcetype=WinEventLog:Security EventCode=4625 earliest=-25h@h latest=-1h@h 
| eval Account_Name=mvindex(Account_Name, 1) 
| search Source_Network_Address!="-" 
| stats count(EventCode) as Authentication_Failures values(Source_Network_Address) as Source_Network_Address by Account_Name 
| search Authentication_Failures &amp;gt; 10 
| sort -Authentication_Failures
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2017 14:35:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322137#M159972</guid>
      <dc:creator>Grumpalot</dc:creator>
      <dc:date>2017-07-21T14:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322138#M159973</link>
      <description>&lt;P&gt;Just add this to the bottom of your existing search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(*) AS * BY Account_Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(Authentication_Failures) AS Authentication_Failures list(Source_Network_Address) AS Source_Network_Address BY Account_Name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jul 2017 02:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322138#M159973</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-23T02:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Counting &amp; Grouping Field Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322139#M159974</link>
      <description>&lt;P&gt;Much appreciated @woodcock!  Thank you for taking the time to help me out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 07:11:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-Grouping-Field-Values/m-p/322139#M159974</guid>
      <dc:creator>MikeElliott</dc:creator>
      <dc:date>2017-07-24T07:11:25Z</dc:date>
    </item>
  </channel>
</rss>

