<?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: Ratio using src_bytes instead of count for two fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54718#M179758</link>
    <description>&lt;P&gt;I don't know what your results look like, so not sure.  That said, here's another search which should give you a ratio:&lt;/P&gt;

&lt;P&gt;index=proxysg sourcetype=proxysg | eval Category=case(like(category,"IBC Allow%"),"IBC",1=1,"Non-IBC") | stats sum(eval(round(if(Category="IBC",src_bytes,0)/1024/1024,2))) AS IBC_MB, sum(eval(round(if(Category="Non-IBC",src_bytes,0)/1024/1024,2))) AS Non-IBC_MB | eval Ratio=IBC_MB/Non-IBC_MB&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:42:59 GMT</pubDate>
    <dc:creator>srioux</dc:creator>
    <dc:date>2020-09-28T14:42:59Z</dc:date>
    <item>
      <title>Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54710#M179750</link>
      <description>&lt;P&gt;how can I do a ratio search not based on count, but based on src_bytes (inbound traffic) to get a ratio for two fields. For example, I want to do a ratio of two categories Shopping sites to Search Engine sites, but not by count but by bandwidth (src_bytes).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54710#M179750</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2020-09-28T14:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54711#M179751</link>
      <description>&lt;P&gt;You didn't give us a lot to go on.&lt;/P&gt;

&lt;P&gt;Assuming that the two record types would have differing sourcetype (which they might not), the following should work:&lt;/P&gt;

&lt;P&gt;...your base search search here... | stats sum(src_bytes) AS Size by sourcetype&lt;/P&gt;

&lt;P&gt;That would create a sum of the values in src_bytes, using sourcetype as a grouping, over the timeframe of your search.  If you have another field differentiating the two categories, you should be able to use that instead of sourcetype.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 12:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54711#M179751</guid>
      <dc:creator>srioux</dc:creator>
      <dc:date>2013-09-05T12:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54712#M179752</link>
      <description>&lt;P&gt;Here's what i'm trying to do. I'm trying to get a ratio of events within a category, but I'm only concern with two events. One event is in the category IBC.  The other events I want to consolidate those into one event in the category, to get a ratio of IBC to Non IBC traffic by src_bytes.&lt;BR /&gt;
index=proxysg sourcetype=proxysg | stats sum(src_bytes) as MB by category | eval MB=round(MB/1024/1024,2) | category!=IBC Allow* as Non-Ibc, category=IBC Allow as IbC Allow&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54712#M179752</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2020-09-28T14:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54713#M179753</link>
      <description>&lt;P&gt;Is 'category' a field in your raw data, do you have it extracted, or is that piece of the search still pending?  Can you provide a few sample records (anonymize the data set as required).&lt;/P&gt;

&lt;P&gt;There are likely a few ways to get what you're looking for.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54713#M179753</guid>
      <dc:creator>srioux</dc:creator>
      <dc:date>2013-09-05T14:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54714#M179754</link>
      <description>&lt;P&gt;Category is an extracted field. This search didn't work for me at all. This is the basic search I started out with manipulating to try to yield some results.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54714#M179754</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-09-05T14:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54715#M179755</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;

&lt;P&gt;index=proxysg sourcetype=proxysg | eval Category=case(like(category,"IBC Allow%"),"IBC",1=1,"Non-IBC") | stats sum(src_bytes) AS Bytes by Category | eval MB=round(Bytes/1024/1024,2)&lt;/P&gt;

&lt;P&gt;The ratios may need to be calculated once we've appropriately categorized the data.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54715#M179755</guid>
      <dc:creator>srioux</dc:creator>
      <dc:date>2013-09-05T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54716#M179756</link>
      <description>&lt;P&gt;The results shown was the two Category's IBC, Non-IBC along with Bytes field and MB field.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54716#M179756</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-09-05T14:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54717#M179757</link>
      <description>&lt;P&gt;Is it possible to have it setup like this? I'm mainly concern with the layout of the results. The results of this shows a list of bases with the post, gets and the ratio of get/post:&lt;BR /&gt;
index=proxysg sourcetype=proxysg | stats count(eval(method="POST")) as POST, count(eval(method="GET")) AS GET by base | eval RATIO OF GET/POST=(GET/POST&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 15:31:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54717#M179757</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-09-05T15:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54718#M179758</link>
      <description>&lt;P&gt;I don't know what your results look like, so not sure.  That said, here's another search which should give you a ratio:&lt;/P&gt;

&lt;P&gt;index=proxysg sourcetype=proxysg | eval Category=case(like(category,"IBC Allow%"),"IBC",1=1,"Non-IBC") | stats sum(eval(round(if(Category="IBC",src_bytes,0)/1024/1024,2))) AS IBC_MB, sum(eval(round(if(Category="Non-IBC",src_bytes,0)/1024/1024,2))) AS Non-IBC_MB | eval Ratio=IBC_MB/Non-IBC_MB&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:42:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54718#M179758</guid>
      <dc:creator>srioux</dc:creator>
      <dc:date>2020-09-28T14:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54719#M179759</link>
      <description>&lt;P&gt;that GET/POST one I sent you showed results like this:&lt;BR /&gt;
   base      POST  GET  RATIO OF GET/POST&lt;BR /&gt;
1. base a     9     9        1&lt;BR /&gt;
2. base b     6     2        0.33&lt;BR /&gt;
3. base c     2     3        1.50&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 17:12:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54719#M179759</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-09-05T17:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54720#M179760</link>
      <description>&lt;P&gt;I have a question. On the first ratio search you sent, is it possible to have the search show like this:&lt;BR /&gt;
base    IbC   Non-IbC  Ratio of IbC/Non-IbC&lt;BR /&gt;
base a   22    23             0.96&lt;BR /&gt;
base b   6      7             0.86&lt;BR /&gt;
base c   25    26             0.96&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2013 16:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54720#M179760</guid>
      <dc:creator>jaywilwk</dc:creator>
      <dc:date>2013-09-09T16:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio using src_bytes instead of count for two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54721#M179761</link>
      <description>&lt;P&gt;Try:&lt;BR /&gt;
index=proxysg sourcetype=proxysg | eval Category=case(like(category,"IBC Allow%"),"IBC",1=1,"Non-IBC") | stats sum(eval(round(if(Category="IBC",src_bytes,0)/1024/1024,2))) AS IBC_MB, sum(eval(round(if(Category="Non-IBC",src_bytes,0)/1024/1024,2))) AS Non_IBC_MB by base | eval Ratio=IBC_MB/Non_IBC_MB&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ratio-using-src-bytes-instead-of-count-for-two-fields/m-p/54721#M179761</guid>
      <dc:creator>srioux</dc:creator>
      <dc:date>2020-09-28T14:44:31Z</dc:date>
    </item>
  </channel>
</rss>

