<?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: limit timechart average values to two places in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103594#M26784</link>
    <description>&lt;P&gt;Just a heads up for anyone trying this, that eval naming is still required. Martin's example does it with the 'by' clause, or you can use the 'AS' to rename. &lt;/P&gt;

&lt;P&gt;Won't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=15m eval(round(avg(RMS_Watts_Tot),2)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;^^ Error in 'timechart' command: The eval expression 'eval(round(avg(RMS_Watts_Tot),2))' must be renamed.&lt;/P&gt;

&lt;P&gt;Works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=15m eval(round(avg(RMS_Watts_Tot),2)) AS watts
| timechart span=15m eval(round(avg(RMS_Watts_Tot),2)) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:17:10 GMT</pubDate>
    <dc:creator>mattymo</dc:creator>
    <dc:date>2020-09-29T14:17:10Z</dc:date>
    <item>
      <title>limit timechart average values to two places</title>
      <link>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103590#M26780</link>
      <description>&lt;P&gt;I'm attempting to look at average free memory in GB on a number of servers (named server01, server02, etc) over time.  &lt;/P&gt;

&lt;P&gt;Doing this simple query I get the information I'm looking for, and the data is in gigabytes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype="windows_performance" Host="server*" object="Memory" counter="Available MBytes" |  eval FreeGB=(Value/1024) | timechart span=30m avg(FreeGB) by Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem I'm encountering is that I'd like to present the timecharted values as having only two decimal places, and I can't figure out how.  Using "round" in the eval statement [for example eval FreeGB=round((Value/1024),2)] doesn't seem to work.  &lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2013 23:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103590#M26780</guid>
      <dc:creator>dang</dc:creator>
      <dc:date>2013-07-22T23:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: limit timechart average values to two places</title>
      <link>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103591#M26781</link>
      <description>&lt;P&gt;"ROUND" is okay. Do you want to be a display what results? Value Is it a numeric type?Error Is the output to "search.log"?&lt;/P&gt;

&lt;P&gt;round((tonumber(Value)/1024),2)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2013 23:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103591#M26781</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2013-07-22T23:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: limit timechart average values to two places</title>
      <link>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103592#M26782</link>
      <description>&lt;P&gt;You could roll it all into one eval timechart function:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart span=30m eval(round(avg(Value)/1024,2)) by Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will compute the average, convert to GB, and round to tens of MB.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2013 06:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103592#M26782</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-07-23T06:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: limit timechart average values to two places</title>
      <link>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103593#M26783</link>
      <description>&lt;P&gt;Thank you, Martin.  That was the answer I was looking for.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2013 15:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103593#M26783</guid>
      <dc:creator>dang</dc:creator>
      <dc:date>2013-07-23T15:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: limit timechart average values to two places</title>
      <link>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103594#M26784</link>
      <description>&lt;P&gt;Just a heads up for anyone trying this, that eval naming is still required. Martin's example does it with the 'by' clause, or you can use the 'AS' to rename. &lt;/P&gt;

&lt;P&gt;Won't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=15m eval(round(avg(RMS_Watts_Tot),2)) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;^^ Error in 'timechart' command: The eval expression 'eval(round(avg(RMS_Watts_Tot),2))' must be renamed.&lt;/P&gt;

&lt;P&gt;Works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=15m eval(round(avg(RMS_Watts_Tot),2)) AS watts
| timechart span=15m eval(round(avg(RMS_Watts_Tot),2)) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/limit-timechart-average-values-to-two-places/m-p/103594#M26784</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2020-09-29T14:17:10Z</dc:date>
    </item>
  </channel>
</rss>

