<?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 find total byte count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122081#M32852</link>
    <description>&lt;P&gt;Not sure how I missed this, thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2015 23:12:28 GMT</pubDate>
    <dc:creator>DEAD_BEEF</dc:creator>
    <dc:date>2015-04-02T23:12:28Z</dc:date>
    <item>
      <title>How to find total byte count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122079#M32850</link>
      <description>&lt;P&gt;I am looking through my firewall logs and would like to find the total byte count between a single source and a single destination.  There are multiple byte count values over the 2-hour search duration and I would simply like to see a table listing the source, destination, and total byte count.&lt;/P&gt;

&lt;P&gt;I've tried stats and eventstats but nothing seems to work right.&lt;/P&gt;

&lt;P&gt;Current query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=fw_log src_ip=1.2.3.4 dst_ip=5.6.7.8 | eventstats sum(bytes) AS "Total Bytes" by src_ip | table src_ip,dst_ip,"Total Bytes"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    src_ip     dst_ip   Total Bytes
    1.2.3.4    5.6.7.8  94782161
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'm getting is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    src_ip     dst_ip   Total Bytes
    1.2.3.4    5.6.7.8  37473882
    1.2.3.4    5.6.7.8  37473882
    1.2.3.4    5.6.7.8  37473882
    1.2.3.4    5.6.7.8  37473882
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Apr 2015 22:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122079#M32850</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2015-04-02T22:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to find total byte count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122080#M32851</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=fw_log src_ip=1.2.3.4 dst_ip=5.6.7.8 | stats sum(bytes) AS "Total Bytes" by src_ip dst_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will give you the one row.   You don't want to use eventstats here, but rather its bigger brother stats.  Stats with a "by foo" or "by foo bar", will output one row for every unique combination of the "by" fields.  Eventstats however, will output pretty much exactly the same rows that it received from the prior command, except that it will have tacked on a couple extra fields that it computed in various ways. &lt;/P&gt;

&lt;P&gt;If you want to see all pairs of src_ip and dst_ip,  that would be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=fw_log  | stats sum(bytes) AS "Total Bytes" by src_ip dst_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:24:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122080#M32851</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-09-28T19:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to find total byte count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122081#M32852</link>
      <description>&lt;P&gt;Not sure how I missed this, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 23:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122081#M32852</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2015-04-02T23:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find total byte count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122082#M32853</link>
      <description>&lt;P&gt;How do you convert the Total Bytes into mb or gb from this search?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 16:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122082#M32853</guid>
      <dc:creator>velthias</dc:creator>
      <dc:date>2020-01-20T16:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find total byte count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122083#M32854</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=fw_log  
| stats sum(bytes) AS Total_Bytes
sum(eval(round(bytes/1024))) AS Total_Bytes_MB
sum(eval(round(bytes/1024/1024))) AS "otal_Bytes_GB by src_ip dst_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=fw_log  
| stats sum(bytes) AS Total_Bytes by src_ip dst_ip
| eval Total_Bytes_MB= round(Total_Bytes/1024)
| eval Total_Bytes_GB=round(Total_Bytes/1024/1024)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jan 2020 17:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-total-byte-count/m-p/122083#M32854</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-20T17:16:53Z</dc:date>
    </item>
  </channel>
</rss>

