<?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: round number from max (*) as * and also avg(*) as * in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186831#M53807</link>
    <description>&lt;P&gt;no worries, my fault. i might not of explain it clearly. without the round my query produce the results #.###### (6 decimal places)&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2014 18:31:30 GMT</pubDate>
    <dc:creator>mmouse88</dc:creator>
    <dc:date>2014-06-03T18:31:30Z</dc:date>
    <item>
      <title>round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186823#M53799</link>
      <description>&lt;P&gt;I have a created a table using timechart with the max #.  It generates a row of maximum of sourcetype.  How would I round the max # to 0 decimal.  Here's my command:&lt;/P&gt;

&lt;P&gt;timechart sum(eval(quantity/12)) span=1h by sourcetype | stats max(*) as * &lt;/P&gt;

&lt;P&gt;timechart sum(eval(quantity/12)) span=1h by sourcetype | stats avg(*) as * &lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 12:40:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186823#M53799</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-03T12:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186824#M53800</link>
      <description>&lt;P&gt;How about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval quantity=round(quantity/12) | timechart sum(quantity) span=1h by sourcetype | stats max(*) as * 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Try this:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | timechart sum(eval(quantity/12)) span=1h by sourcetype | stats max(*) as * 
| replace *.* with *#* | convert rmunit(*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;Updated answer&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
Don't know why I didn't think of this before. Try this&lt;/P&gt;

&lt;P&gt;For max(*) as *&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search | bucket span=1h _time  | stats  sum(eval(quantity/12)) as total by _time, sourcetype | eval total=round(total) | eval temp=1| chart first(total) as total  over temp by sourcetype | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For avg(*) as *&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | bucket span=1h _time  | stats  sum(eval(quantity/12)) as total by _time, sourcetype | stats avg(total) as total by sourcetype | eval total=round(total) | eval temp=1| chart first(total) as total  over temp by sourcetype | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jun 2014 13:39:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186824#M53800</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T13:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186825#M53801</link>
      <description>&lt;P&gt;sorry, it didn't work. results produce all 0s&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 17:36:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186825#M53801</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-03T17:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186826#M53802</link>
      <description>&lt;P&gt;Can you post your current working query? one with no rounding?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 17:49:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186826#M53802</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T17:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186827#M53803</link>
      <description>&lt;P&gt;if i add to your command: eval quantity=round(quantity/12,1).  It gives me one decimal place which is pretty close to what I want.  would like 0 decimal places. replace ,1 with 0 then results is all 0s.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 17:52:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186827#M53803</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-03T17:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186828#M53804</link>
      <description>&lt;P&gt;If you want no decimal places then you don't have to specify the precision (see the syntax in my answer).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 17:59:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186828#M53804</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T17:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186829#M53805</link>
      <description>&lt;P&gt;precision, do u mean to remove the divide by 12?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 18:14:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186829#M53805</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-03T18:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186830#M53806</link>
      <description>&lt;P&gt;Sorry I got confused. Are the values for field quantity less than 6??&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 18:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186830#M53806</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T18:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186831#M53807</link>
      <description>&lt;P&gt;no worries, my fault. i might not of explain it clearly. without the round my query produce the results #.###### (6 decimal places)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 18:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186831#M53807</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-03T18:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186832#M53808</link>
      <description>&lt;P&gt;Try the updated answer. Note that its not doing the rounding, its just truncating anything after the decimal point.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2014 20:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186832#M53808</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-03T20:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186833#M53809</link>
      <description>&lt;P&gt;thx. It was able to convert or truncate some values after the decimal.  Only 5 values (column 1, 4, 5, 11) had no decimal.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 00:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186833#M53809</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-04T00:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186834#M53810</link>
      <description>&lt;P&gt;Can you paste some of the result which it was not able to truncate?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 12:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186834#M53810</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-04T12:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186835#M53811</link>
      <description>&lt;P&gt;here are the values:&lt;BR /&gt;
26   7.666636  7  6  5.583311  3.249987  2.999988  2&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:45:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186835#M53811</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-04T17:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186836#M53812</link>
      <description>&lt;P&gt;Got another alternative. Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 18:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186836#M53812</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-04T18:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186837#M53813</link>
      <description>&lt;P&gt;awesome. it worked.  Thank you.  can i ask for the second part using avg(*) as *&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 18:42:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186837#M53813</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-04T18:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186838#M53814</link>
      <description>&lt;P&gt;See the updated answer. I also updated the previous one to remove _time from final result.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 19:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186838#M53814</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-04T19:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: round number from max (*) as * and also avg(*) as *</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186839#M53815</link>
      <description>&lt;P&gt;Excellent both worked.  Thank you so much for your dedication&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2014 22:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-number-from-max-as-and-also-avg-as/m-p/186839#M53815</guid>
      <dc:creator>mmouse88</dc:creator>
      <dc:date>2014-06-04T22:38:19Z</dc:date>
    </item>
  </channel>
</rss>

