<?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 How to edit my search to get results to display volume as BYTES, KB, MB, GB,  and TB? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250569#M74873</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have search and currently the results show in MB.  For example:&lt;/P&gt;

&lt;P&gt;Current Search:&lt;/P&gt;

&lt;P&gt;Vol in MB&lt;BR /&gt;
112435&lt;BR /&gt;
9734&lt;BR /&gt;
29845&lt;BR /&gt;
725634&lt;BR /&gt;
3564476&lt;BR /&gt;
233463&lt;/P&gt;

&lt;P&gt;I would like to have it show up as like the below example:&lt;/P&gt;

&lt;P&gt;Volume&lt;BR /&gt;
723 MB&lt;BR /&gt;
14MB&lt;BR /&gt;
12KB&lt;BR /&gt;
12GB&lt;BR /&gt;
1.2 TB&lt;/P&gt;

&lt;P&gt;Here is the search context which we are using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pan_logs $vsys_name$ eventtype=pan_traffic action=allowed   | stats sparkline sum(bytes) AS sbytes by app | sort -sbytes | head 8 | eval Application=upper(app) | eval "Vol in MB"=round(sbytes/1024/1024) | rename sparkline AS Distribution | table Application "Vol in MB" Distribution
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;P&gt;Application.........................Vol in MB................. Distribution&lt;BR /&gt;
Quic...................................... 342&lt;BR /&gt;
Wb-Browsing........................306&lt;BR /&gt;&lt;BR /&gt;
SSL.........................................26&lt;BR /&gt;
MS-SMS.................................14&lt;BR /&gt;
Google-Base.........................13&lt;BR /&gt;
Skype.....................................3&lt;BR /&gt;
MS-Update............................2&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2016 18:17:07 GMT</pubDate>
    <dc:creator>elijahputnam</dc:creator>
    <dc:date>2016-08-25T18:17:07Z</dc:date>
    <item>
      <title>How to edit my search to get results to display volume as BYTES, KB, MB, GB,  and TB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250569#M74873</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have search and currently the results show in MB.  For example:&lt;/P&gt;

&lt;P&gt;Current Search:&lt;/P&gt;

&lt;P&gt;Vol in MB&lt;BR /&gt;
112435&lt;BR /&gt;
9734&lt;BR /&gt;
29845&lt;BR /&gt;
725634&lt;BR /&gt;
3564476&lt;BR /&gt;
233463&lt;/P&gt;

&lt;P&gt;I would like to have it show up as like the below example:&lt;/P&gt;

&lt;P&gt;Volume&lt;BR /&gt;
723 MB&lt;BR /&gt;
14MB&lt;BR /&gt;
12KB&lt;BR /&gt;
12GB&lt;BR /&gt;
1.2 TB&lt;/P&gt;

&lt;P&gt;Here is the search context which we are using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pan_logs $vsys_name$ eventtype=pan_traffic action=allowed   | stats sparkline sum(bytes) AS sbytes by app | sort -sbytes | head 8 | eval Application=upper(app) | eval "Vol in MB"=round(sbytes/1024/1024) | rename sparkline AS Distribution | table Application "Vol in MB" Distribution
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;P&gt;Application.........................Vol in MB................. Distribution&lt;BR /&gt;
Quic...................................... 342&lt;BR /&gt;
Wb-Browsing........................306&lt;BR /&gt;&lt;BR /&gt;
SSL.........................................26&lt;BR /&gt;
MS-SMS.................................14&lt;BR /&gt;
Google-Base.........................13&lt;BR /&gt;
Skype.....................................3&lt;BR /&gt;
MS-Update............................2&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 18:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250569#M74873</guid>
      <dc:creator>elijahputnam</dc:creator>
      <dc:date>2016-08-25T18:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get results to display volume as BYTES, KB, MB, GB,  and TB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250570#M74874</link>
      <description>&lt;P&gt;Try this (you may have to fix the math &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Volume=case(sbytes&amp;lt;=1024, sbytes." B", sbytes&amp;gt;1024 AND sbytes&amp;lt;=(1024*1024), round(sbytes/(1024),1)." KB", sbytes&amp;gt;(1024*1024) AND sbytes&amp;lt;=(1024*1024*1024), round(sbytes/(1024*1024), 1)." MB", sbytes&amp;gt;(1024*1024*1024) AND sbytes&amp;lt;=(1024*1024*1024*1024), round(sbytes/(1024*1024*1024), 1)." GB", sbytes&amp;gt;(1024*1024*1024*1024), round(sbytes/(1024*1024*1024*1024), 1)." TB", 1=1, "UNK")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2016 18:50:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250570#M74874</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-25T18:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get results to display volume as BYTES, KB, MB, GB,  and TB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250571#M74875</link>
      <description>&lt;P&gt;I added what you posted to my search but now the values are showing up blank under "Vol in MB"&lt;/P&gt;

&lt;P&gt;Here is my complete search now.&lt;/P&gt;

&lt;P&gt;index=pan_logs $vsys_name$ eventtype=pan_traffic action=allowed   | stats sparkline sum(bytes) AS sbytes by app | sort -sbytes | head 8 | eval Application=upper(app) | &lt;STRONG&gt;eval Volume=case(sbytes&amp;lt;=1024, sbytes." B", sbytes&amp;gt;1024 AND sbytes&amp;lt;=(1024*1024), round(sbytes/(1024),1)." KB", sbytes&amp;gt;(1024*1024) AND sbytes&amp;lt;=(1024*1024*1024), round(sbytes/(1024*1024), 1)." MB", sbytes&amp;gt;(1024*1024*1024) AND sbytes&amp;lt;=(1024*1024*1024*1024), round(sbytes/(1024*1024*1024), 1)." GB", sbytes&amp;gt;(1024*1024*1024*1024), round(sbytes/(1024*1024*1024*1024), 1)." TB", 1=1, "UNK")&lt;/STRONG&gt; |  rename sparkline AS Distribution | table Application "Vol in MB" Distribution&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:45:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250571#M74875</guid>
      <dc:creator>elijahputnam</dc:creator>
      <dc:date>2020-09-29T10:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get results to display volume as BYTES, KB, MB, GB,  and TB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250572#M74876</link>
      <description>&lt;P&gt;Change "Vol in MB" to Volume, in your last table segment. Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | table Application Volume Distribution
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2016 19:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-results-to-display-volume-as-BYTES/m-p/250572#M74876</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-25T19:43:05Z</dc:date>
    </item>
  </channel>
</rss>

