<?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: Converting from MB to GB not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470212#M132313</link>
    <description>&lt;P&gt;Thanks somesoni2 but this coding is not working for me. Still doesn't display the GB. I have played around with some coding and I find this gives me a result but not sure how accurate it is. Sorry new to Splunk and coding so not sure if this is showing a result of MB converting to GB? Is it correct?&lt;/P&gt;

&lt;P&gt;index=*&lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd by app &lt;BR /&gt;
| eval TotalGB=round((TotalSent+TotalRcvd)/1024,2) &lt;BR /&gt;
| addtotals &lt;BR /&gt;
| dedup app &lt;BR /&gt;
| sort -Total &lt;BR /&gt;
| head 30&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 23:39:29 GMT</pubDate>
    <dc:creator>annageorgiou</dc:creator>
    <dc:date>2020-02-12T23:39:29Z</dc:date>
    <item>
      <title>Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470203#M132304</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;I have my query and doesn't seem to convert from MB to GB. What am I doing wrong? Can anyone help me?&lt;/P&gt;

&lt;P&gt;index= * &lt;BR /&gt;
| eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2) &lt;BR /&gt;
| eval TotalGB=round(TotalMB/1024,2) &lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd by app&lt;BR /&gt;
| addtotals &lt;BR /&gt;
| dedup app &lt;BR /&gt;
| sort limit=30 - total&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 03:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470203#M132304</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-11T03:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470204#M132305</link>
      <description>&lt;P&gt;@annageorgiou ,&lt;/P&gt;

&lt;P&gt;In your search, you are not usnig the evaluated fields in your &lt;CODE&gt;stats&lt;/CODE&gt; command. &lt;/P&gt;

&lt;P&gt;Can you run the search and check if its working for you ? &lt;BR /&gt;
    index= * "other search terms"&lt;BR /&gt;
    | fields TotalSent,TotalRcvd&lt;BR /&gt;
    | eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)&lt;BR /&gt;
    | eval TotalGB=round(TotalMB/1024,2) &lt;BR /&gt;
    |table TotalSent,TotalRcvd,TotalMB,TotalGB&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 05:05:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470204#M132305</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-02-11T05:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470205#M132306</link>
      <description>&lt;P&gt;I just ran your exact search with my index and it didn't work. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 05:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470205#M132306</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-11T05:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470206#M132307</link>
      <description>&lt;P&gt;I found this coding but this does not appear to be working for me either. I wanted a search by app and total to GB &lt;/P&gt;

&lt;P&gt;index= *&lt;BR /&gt;
|stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd&lt;BR /&gt;&lt;BR /&gt;
 |eval TotalDownload=round((TotalRcvd)/1024/1024,2) &lt;BR /&gt;
 |eval TotalUpload=round((TotalSent)/1024/1024,2) &lt;BR /&gt;
 |eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)&lt;BR /&gt;
 |eval TotalGB=round((TotalMB)/1024,2) &lt;BR /&gt;
 |table TotalDownload TotalUpload TotalGB&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 05:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470206#M132307</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-11T05:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470207#M132308</link>
      <description>&lt;P&gt;Hi @annageorgiou,&lt;BR /&gt;
as @renjith.nair said, after stats command you have only the fields of stats command, in your case only TotalSent, TotalRcvd and app; to use some other fields you have to use other functions like values, sum, max, avg.&lt;BR /&gt;
So in your search, try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= *
| eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)
| eval TotalGB=round(TotalMB/1024,2)
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd values(TotalGB) AS TotalGB by app
| addtotals
| sort limit=30 - total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;p.s.: you don't need dedup after stats.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 07:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470207#M132308</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-11T07:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470208#M132309</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;

&lt;P&gt;Thanks for the coding and I have tried it but again it doesn't give me the GB's. This is just an example of the result and I only included first App, It appears in MB (I think) and I get no totals in the 'TotalGB' column. Can you please help? P.s. Can't line up the APP row to go under the headings. There was no GB's in that column.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    app        TotalSent        TotalRcvd       TotalGB     Total   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1   HTTP    1348273             830314                                      2178587&lt;/P&gt;

&lt;P&gt;index= *&lt;BR /&gt;
| eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)&lt;BR /&gt;
| eval TotalGB=round(TotalMB/1024,2)&lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd values(TotalGB) AS TotalGB by app&lt;BR /&gt;
| addtotals&lt;BR /&gt;
| sort -Total &lt;BR /&gt;
| head 30&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 22:03:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470208#M132309</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-11T22:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470209#M132310</link>
      <description>&lt;P&gt;Try this (assuming your data has field sentbyte, rcvdbyte and app extracted. Consider adding some metadata filter to your search e.g index/sourcetype/source/host for better query performance)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= *
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd values(TotalGB) AS TotalGB by app
| eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)
| eval TotalGB=round(TotalMB/1024,2)
| sort -TotalGB
| head 30
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 22:31:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470209#M132310</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-02-11T22:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470210#M132311</link>
      <description>&lt;P&gt;Hi @annageorgiou,&lt;BR /&gt;
try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= *
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd by app
| eval TotalMB=round((TotalSent+TotalRcvd)/1024/1024,2)
| eval TotalGB=round(TotalMB/1024,2)
| addtotals
| sort -TotalGB
| head 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 12:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470210#M132311</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-12T12:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470211#M132312</link>
      <description>&lt;P&gt;I'm not sure why it's not working. I played around with it and came up with this but unsure if it's giving me the correct information. It is converting MB to GB right? Sorry... new to splunk and coding.&lt;/P&gt;

&lt;P&gt;index=*&lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd by app &lt;BR /&gt;
| eval TotalGB=round((TotalSent+TotalRcvd)/1024,2) &lt;BR /&gt;
| addtotals &lt;BR /&gt;
| dedup app &lt;BR /&gt;
| sort -Total &lt;BR /&gt;
| head 30&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 23:36:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470211#M132312</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-12T23:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470212#M132313</link>
      <description>&lt;P&gt;Thanks somesoni2 but this coding is not working for me. Still doesn't display the GB. I have played around with some coding and I find this gives me a result but not sure how accurate it is. Sorry new to Splunk and coding so not sure if this is showing a result of MB converting to GB? Is it correct?&lt;/P&gt;

&lt;P&gt;index=*&lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd by app &lt;BR /&gt;
| eval TotalGB=round((TotalSent+TotalRcvd)/1024,2) &lt;BR /&gt;
| addtotals &lt;BR /&gt;
| dedup app &lt;BR /&gt;
| sort -Total &lt;BR /&gt;
| head 30&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 23:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470212#M132313</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-12T23:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470213#M132314</link>
      <description>&lt;P&gt;Hi @annageorgiou,&lt;BR /&gt;
there's a problem: sentbyte and rcvdbyte are in bytes, so if you don't use the first eval you haven't the value in GB but in kB, to have GB conversion in only one line, you have to divide three times for 1024:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TotalGB=round((TotalSent+TotalRcvd)/1024/1024/1024,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in this way it should be correct.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 08:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470213#M132314</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-13T08:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470214#M132315</link>
      <description>&lt;P&gt;Thanks for your help Guiseppe but the only coding that worked for me is below. I'm pretty sure it's showing me GB. I tried your coding but it's still not showing me the GB amounts. I've changed it to NOT show by app now and just give me an overall amount. if I use 1024/1024/1024 it doesn't work. Do you think this coding would show me GB or Bytes?&lt;/P&gt;

&lt;P&gt;index=*&lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd &lt;BR /&gt;
| eval TotalSent=round((TotalSent)/1024,2) &lt;BR /&gt;
| eval TotalRcvd=round((TotalRcvd)/1024,2) &lt;BR /&gt;
| addtotals&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 22:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470214#M132315</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-13T22:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470215#M132316</link>
      <description>&lt;P&gt;Okay... I fiddled with the coding and I think I have it!!! This actually gives me GB's&lt;/P&gt;

&lt;P&gt;index= *&lt;BR /&gt;
| stats sum(sentbyte) AS TotalSent, sum(rcvdbyte) AS TotalRcvd &lt;BR /&gt;
| eval TotalSent=round((TotalSent)/1024/1024,2) &lt;BR /&gt;
| eval TotalRcvd=round((TotalRcvd)/1024/1024,2)&lt;BR /&gt;
| eval TotalGB=round((TotalSent+TotalRcvd),2)&lt;BR /&gt;
| table TotalSent TotalRcvd TotalGB&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 04:50:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470215#M132316</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-14T04:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470216#M132317</link>
      <description>&lt;P&gt;I figured out that it doesn't work with 3 of the 1024 in your coding (1024,1024,1024). What I think it's doing is using the Sentbyte or Rcvdbyte as 1024 so you only need another 2 of the 1024 in your coding to divide it to get to GB. I'm not sure if I made sense... but it works. &lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 05:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470216#M132317</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-14T05:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470217#M132318</link>
      <description>&lt;P&gt;Hi @annageorgiou,&lt;BR /&gt;
it should be the same thing, but the importance is that you solved your problem!&lt;BR /&gt;
Please accept and or upvote this answer to share it withthe other people of community.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 07:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470217#M132318</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-14T07:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from MB to GB not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470218#M132319</link>
      <description>&lt;P&gt;Thanks Giuseppe &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2020 21:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-from-MB-to-GB-not-working/m-p/470218#M132319</guid>
      <dc:creator>annageorgiou</dc:creator>
      <dc:date>2020-02-16T21:38:07Z</dc:date>
    </item>
  </channel>
</rss>

