<?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: how to group events based on specific conditions. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493173#M137544</link>
    <description>&lt;P&gt;Could you please elaborate as to what "Maximum attempts" is? I believe the SPL that you wrote already is giving you the count of all the attempts made for authentication by a src to a dest. Do you want to compare the attempts made in the time frame that you're running the SPL in vs the whole day's time frame or something else.&lt;/P&gt;</description>
    <pubDate>Mon, 11 May 2020 08:57:12 GMT</pubDate>
    <dc:creator>shivanshu1593</dc:creator>
    <dc:date>2020-05-11T08:57:12Z</dc:date>
    <item>
      <title>how to group events based on specific conditions.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493172#M137543</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to group few events based on the success and failure action for a particular user and dest as below. Kindly help in writing a query like this.&lt;/P&gt;

&lt;P&gt;Using streamstats I got things like below. Query which I have used here&lt;/P&gt;

&lt;P&gt;index=wineventlog_sec* tag=authentication (action=success OR action=failure) &lt;BR /&gt;
| table _time user dest EventCode action &lt;BR /&gt;
| sort 0 _time user dest &lt;BR /&gt;
| streamstats count as attempts by action user dest reset_on_change=true&lt;/P&gt;

&lt;P&gt;Time  User  Dest   action     attempts&lt;BR /&gt;
T1      U1      D1      success     1&lt;BR /&gt;
T2      U1      D1      success     2&lt;BR /&gt;
T3      U1      D1      failure       1&lt;BR /&gt;
T4      U1      D1      failure       2&lt;BR /&gt;
T5      U1      D1      failure       3&lt;BR /&gt;
T6      U1      D1      success     1&lt;BR /&gt;
T7      U1      D1      success     2&lt;BR /&gt;
T8      U1      D1      success     3&lt;/P&gt;

&lt;P&gt;How to get the max attempts performed for a particular group of user dest and action (all 3 should be present) like below.&lt;/P&gt;

&lt;P&gt;Time  User  Dest   action     attempts     max_attempts&lt;BR /&gt;
T1      U1      D1      success     1                       2&lt;BR /&gt;
T2      U1      D1      success     2                       2&lt;BR /&gt;
T3      U1      D1      failure       1                       3&lt;BR /&gt;
T4      U1      D1      failure       2                       3&lt;BR /&gt;
T5      U1      D1      failure       3                       3&lt;BR /&gt;
T6      U1      D1      success     1                       3&lt;BR /&gt;
T7      U1      D1      success     2                       3&lt;BR /&gt;
T8      U1      D1      success     3                       3&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493172#M137543</guid>
      <dc:creator>gndivya</dc:creator>
      <dc:date>2020-09-30T05:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to group events based on specific conditions.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493173#M137544</link>
      <description>&lt;P&gt;Could you please elaborate as to what "Maximum attempts" is? I believe the SPL that you wrote already is giving you the count of all the attempts made for authentication by a src to a dest. Do you want to compare the attempts made in the time frame that you're running the SPL in vs the whole day's time frame or something else.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 08:57:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493173#M137544</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2020-05-11T08:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to group events based on specific conditions.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493174#M137545</link>
      <description>&lt;P&gt;In the second table which I have provided, max_attempts gives the maximum of attempts field wrt success or failure. If there is a failure attempt present after n number of success attempts, then max_attempts for the first success group is n and similarly next group which is failure should have the maximum number of attempts.&lt;BR /&gt;
I hope my explanation is clear&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493174#M137545</guid>
      <dc:creator>gndivya</dc:creator>
      <dc:date>2020-09-30T05:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to group events based on specific conditions.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493175#M137546</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=wineventlog_sec* tag=authentication (action=success OR action=failure)
| table _time user dest EventCode action
| sort 0 _time user dest
| streamstats count as attempts by action user dest reset_on_change=true
| streamstats count(eval(attempts=1)) as sessions by user dest
| eventstats count as max_attempts by sessions user dest
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 10:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493175#M137546</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-11T10:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to group events based on specific conditions.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493176#M137547</link>
      <description>&lt;P&gt;Hi to4kawa,&lt;/P&gt;

&lt;P&gt;The above code worked. When the same query is being modified using a tstats search, I am not able to display all the events that happened at a specific point of time, hence the above code is not giving me the actual maximum attempts, instead, it is giving me the maximum attempts of the data coming.&lt;/P&gt;

&lt;P&gt;At time T1, 2 events has occurred but I am able to see only one when the tstats query is used.&lt;BR /&gt;
How to get the max_attempts in this case.&lt;/P&gt;

&lt;P&gt;Query used.&lt;/P&gt;

&lt;P&gt;| tstats &lt;CODE&gt;summariesonly&lt;/CODE&gt; count values(Authentication.action) as Authentication.action values(Authentication.src) as Authentication.src values(Authentication.signature_id) as Authentication.signature_id values(Authentication.signature) as Authentication.signature from datamodel=Authentication where (Authentication.action=success OR Authentication.action=failure ) by  _time Authentication.user Authentication.dest span=1s &lt;BR /&gt;
| &lt;CODE&gt;drop_dm_object_name("Authentication")&lt;/CODE&gt; &lt;BR /&gt;
| sort 0 user _time  dest&lt;BR /&gt;
| streamstats count as attempts sum(count) as total_count min(count) as min_count by user dest action reset_on_change=true&lt;/P&gt;

&lt;P&gt;Data&lt;/P&gt;

&lt;P&gt;Time User Dest Count action attempts max_attempts total_count min_count&lt;BR /&gt;
T1 U1 D1 2 success 1 5 2  2&lt;BR /&gt;
T2 U1 D1 3 success 2 5 5  2&lt;BR /&gt;
T3 U1 D1 2 failure 1 7  2  2&lt;BR /&gt;
T4 U1 D1 3 failure 2 7  5  2&lt;BR /&gt;
T5 U1 D1 2 failure 3 7  7  2&lt;BR /&gt;
T6 U1 D1 3 success 1 6  3  3&lt;BR /&gt;
T7 U1 D1 2 success 2 6  5   2&lt;BR /&gt;
T8 U1 D1 1 success 3 6  6  1&lt;/P&gt;

&lt;P&gt;I hope my question is clear.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:24:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-group-events-based-on-specific-conditions/m-p/493176#M137547</guid>
      <dc:creator>gndivya</dc:creator>
      <dc:date>2020-09-30T05:24:47Z</dc:date>
    </item>
  </channel>
</rss>

