<?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: Eventstats command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689408#M234930</link>
    <description>&lt;P&gt;Well obviously it is possible! The "issue" is that the total emails are counted by user, subject and action, whereas the other two counts are by just user and subject. You could change the eventstats to correct this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats sum(eval(if(action="quarantined", 1, 0))) as quarantined_count_peruser, sum(eval(if(action="delivered", 1, 0))) as delivered_count_peruser sum(total_emails) as total_emails by src_user, subject&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 03 Jun 2024 12:26:51 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-06-03T12:26:51Z</dc:date>
    <item>
      <title>Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689177#M234872</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm trying to write a Splunk search for detecting unusual behavior in emails sending, here is the spl query:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=true fillnull_value="N/D" dc(All_Email.internal_message_id) as total_emails from datamodel=Email where
(All_Email.action="quarantined" OR All_Email.action="delivered") AND
NOT
[| `email_whitelist_generic`]
by All_Email.src_user, All_Email.subject, All_Email.action
| `drop_dm_object_name("All_Email")`
| eventstats sum(eval(if(action="quarantined", count, 0))) as quarantined_count_peruser, sum(eval(if(action="delivered", count, 0))) as delivered_count_peruser by src_user, subject
| where total_emails&amp;gt;50 AND quarantined_count_peruser&amp;gt;10 AND delivered_count_peruser&amp;gt;0

&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I want to count the number of quarantined emails and the delivered ones only and than filter them for some threshold, but it seems that the eventstats command is not working as expected. I already used this logic for authentication searches and it's working fine.&lt;/P&gt;
&lt;P&gt;Any help?&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 17:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689177#M234872</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2024-05-31T17:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689235#M234891</link>
      <description>&lt;P&gt;I think this query will work for you :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=true fillnull_value="N/D" dc(All_Email.internal_message_id) as total_emails from datamodel=Email where (All_Email.action="quarantined" OR All_Email.action="delivered") AND NOT [| `email_whitelist_generic`] by All_Email.src_user, All_Email.subject, All_Email.action | `drop_dm_object_name("All_Email")` | eventstats sum(eval(if(action="quarantined", 1, 0))) as quarantined_count_peruser, sum(eval(if(action="delivered", 1, 0))) as delivered_count_peruser by src_user, subject | where total_emails &amp;gt; 50 AND quarantined_count_peruser &amp;gt; 10 AND delivered_count_peruser &amp;gt; 0&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 31 May 2024 17:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689235#M234891</guid>
      <dc:creator>marysan</dc:creator>
      <dc:date>2024-05-31T17:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689240#M234892</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246832"&gt;@marysan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the query is the same&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 15:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689240#M234892</guid>
      <dc:creator>marcomassari1</dc:creator>
      <dc:date>2024-05-31T15:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689243#M234893</link>
      <description>&lt;P&gt;sorry&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I made edits to it&amp;nbsp;&lt;BR /&gt;Now it must works&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 May 2024 16:19:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689243#M234893</guid>
      <dc:creator>marysan</dc:creator>
      <dc:date>2024-05-31T16:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689397#M234925</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246832"&gt;@marysan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;it's seems that the result is not as expected:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_massari11_0-1717412251427.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31116i7FA78E3E11A088BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_massari11_0-1717412251427.png" alt="marco_massari11_0-1717412251427.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 10:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689397#M234925</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2024-06-03T10:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689399#M234927</link>
      <description>&lt;P&gt;In what way is it not what you expected? Please share what you had expected?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 11:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689399#M234927</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-06-03T11:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689407#M234929</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the result should be the total emails count, and the specific count for the delivered and quarantined ones. In my screenshot, there are for example 6 total emails (first row), and 12 delivered, which is not possible. So the a possible expectation should be:&lt;/P&gt;&lt;P&gt;Case1: 6 total emails, 6 delivered, 0 quarantined&lt;/P&gt;&lt;P&gt;Case2: 6 total emails, 3 delivered, 3 quarantined&lt;/P&gt;&lt;P&gt;Case3: 6 total emails, 1 delivered, 5 quarantined&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 12:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689407#M234929</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2024-06-03T12:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689408#M234930</link>
      <description>&lt;P&gt;Well obviously it is possible! The "issue" is that the total emails are counted by user, subject and action, whereas the other two counts are by just user and subject. You could change the eventstats to correct this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats sum(eval(if(action="quarantined", 1, 0))) as quarantined_count_peruser, sum(eval(if(action="delivered", 1, 0))) as delivered_count_peruser sum(total_emails) as total_emails by src_user, subject&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Jun 2024 12:26:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689408#M234930</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-06-03T12:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689414#M234933</link>
      <description>&lt;P&gt;Hello, maybe I'm missing some points but it seems that the result is the same&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 13:52:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eventstats-command/m-p/689414#M234933</guid>
      <dc:creator>marco_massari11</dc:creator>
      <dc:date>2024-06-03T13:52:21Z</dc:date>
    </item>
  </channel>
</rss>

