<?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: Table of bytes_out by user, hostname where total bytes out &amp;gt; 1MB in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319186#M10712</link>
    <description>&lt;P&gt;He did state that he wanted the total bytes listed in the results table. But that is a good efficiency note. &lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2017 02:16:05 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-07-19T02:16:05Z</dc:date>
    <item>
      <title>Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319179#M10705</link>
      <description>&lt;P&gt;I have proxy logs that contain three relevant fields: user, hostname, and bytes_out. I have been challenged to generate a notification when the total bytes_out for user A, B, or C exceeds 100MB in the last 24 hours. That notification needs to include a table with the total bytes_out by user, hostname and their total for the 24 hour period.&lt;/P&gt;

&lt;P&gt;So for example say the total bytes_out in the last 24 hours for user=A is 10MB, user=B is 150, and user=C is 200. I should get two alerts - one for user=B and one for user=C. The alert should contain a table like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;B   www.microsoft.com  20MB  150MB
B   www.google.com  40MB  150MB
B   www.apple.com  90MB  150MB
C  www.amazon.com  100  200MB
C  www.dropbox.com  50  200MB
C  www.yahoo.com  40  200MB
C  www.youtube.com  10  200MB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think we could also handle one report with the entire result set. Anyone willing to take a shot at this? It's a bit beyond my current skill level.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:58:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319179#M10705</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2020-09-29T14:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319180#M10706</link>
      <description>&lt;P&gt;How about something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Index=proxylogs earliest=-24h latest=now |eventstats sum(bytes_out) as total_bytes_out by user|stats sum(bytes_out) as bytes_out max(total_bytes_out) as total_bytes_out by user hostname|search total_bytes_out&amp;gt;100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And you can set an alert for whenever this produces results or one per result, depending on preference. &lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 23:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319180#M10706</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-07-18T23:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319181#M10707</link>
      <description>&lt;P&gt;I'll take a shot at it.  See if this gets you started.  It should produce the table you desire.  If it works as you expect, then schedule the search and trigger an alert if the number of results is not zero.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo hostname=* bytes_out=* (user="A" OR user="B" OR user="C") | streamstats sum(bytes_out) as Total_bytes_out by user | eval Total_bytes_out=Total_bytes_out/(1024*1024) | where Total_bytes_out &amp;gt; 100 | table user hostname bytes_out Total_bytes_out
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jul 2017 23:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319181#M10707</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-07-18T23:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319182#M10708</link>
      <description>&lt;P&gt;Just add this to your existing search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats sum(bytes_out) AS TotalBytesOutThisUser BY User
| search TotalBytesOutThisUser &amp;gt; 104857600
| table user hostname bytes_out TotalBytesOutThisUser 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 00:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319182#M10708</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-19T00:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319183#M10709</link>
      <description>&lt;P&gt;&lt;CODE&gt;streamstats&lt;/CODE&gt; is going to add them up one record at a time, so the earlier records will not qualify and will be lost.  use &lt;CODE&gt;eventstats&lt;/CODE&gt; to non-destructively calculate the sum and add it to the entire record set for the user.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 01:53:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319183#M10709</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-19T01:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319184#M10710</link>
      <description>&lt;P&gt;Efficiency note - move the search right after the eventstats to eliminate the unwanted records as early as possible.  Then you can get rid of total_bytes_out from the stats command.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319184#M10710</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-09-29T14:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319185#M10711</link>
      <description>&lt;P&gt;...subject to the assumption that his current search calculates the total bytes by hostname and user...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 01:56:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319185#M10711</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-19T01:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319186#M10712</link>
      <description>&lt;P&gt;He did state that he wanted the total bytes listed in the results table. But that is a good efficiency note. &lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 02:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319186#M10712</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-07-19T02:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Table of bytes_out by user, hostname where total bytes out &gt; 1MB</title>
      <link>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319187#M10713</link>
      <description>&lt;P&gt;Thank you everyone for your feedback. The 'eventstats' command was the key for me. In fact, the idea to try eventstats hit me randomly last night. I worked on the query a bit this morning and came up with this exact solution independently. I just came to verify it against all the comments.&lt;/P&gt;

&lt;P&gt;Thanks again very much for the feedback. It was a useful exercise for me to help wrap my head around the eventstats command.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Table-of-bytes-out-by-user-hostname-where-total-bytes-out-gt-1MB/m-p/319187#M10713</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2017-07-19T14:54:59Z</dc:date>
    </item>
  </channel>
</rss>

